From f62b615ade08696613b6ea9d4433aefd5e47ad9a Mon Sep 17 00:00:00 2001 From: David Young Date: Thu, 14 Jan 2021 14:50:45 +1300 Subject: [PATCH] Trial advising GitHub of new recipe request --- .../notify-discord-new-recipe-request.yml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/notify-discord-new-recipe-request.yml diff --git a/.github/workflows/notify-discord-new-recipe-request.yml b/.github/workflows/notify-discord-new-recipe-request.yml new file mode 100644 index 0000000..28b301f --- /dev/null +++ b/.github/workflows/notify-discord-new-recipe-request.yml @@ -0,0 +1,31 @@ +name: Notify Discord of new recipe requests + +on: + issues: + types: [opened] +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + assign-recipes-to-project: + runs-on: ubuntu-latest + name: notify Discord of new recipe request + steps: + - name: Discord notification + if: | + contains(github.event.issue.labels.*.name, 'recipe/request') + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + DISCORD_EMBEDS: | + { + "description": "{{ EVENT_PAYLOAD.title }}", + "url": "{{ EVENT_PAYLOAD.url }}", + "color": 7418285, + "author": { + "name": "${{github.sender.login}}", + "url": "${{github.sender.html_url}}", + "icon_url": "${{github.sender.avatar_url}}" + } + uses: Ilshidur/action-discord@master@0.3.0 + with: + args: The [Geek's Cookbook](https://geek-cookbook.funkypenguin.co.nz) has a new recipe request! \ No newline at end of file