From b2ffc112576314ae412217b9cfecbfb2602a6110 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Thu, 30 Mar 2023 09:52:05 +0300 Subject: [PATCH] Post commit messages to Slack with Github Actions --- .github/workflows/slack.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/slack.yml diff --git a/.github/workflows/slack.yml b/.github/workflows/slack.yml new file mode 100644 index 00000000..9ee7c66b --- /dev/null +++ b/.github/workflows/slack.yml @@ -0,0 +1,28 @@ +# This is a basic workflow that is manually triggered +name: Slack + +# Controls when the action will run. Workflow runs when manually triggered using the UI or API. +on: + push: + branches: + - 'master' + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + send_webhook: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Webhook + env: + webhook_url: ${{ secrets.ZONE_WEBHOOK_URL }} + curl_options: '--fail -s' + data: '{"channel":"wildduck-changelog", "text": "**${{ github.actor }}** pushed to **${{ github.ref_name }}**"}' + run: | + curl $curl_options \ + -H "Content-Type: application/json" \ + -H "User-Agent: GitHub-Action" \ + --data "$data" $webhook_url