diff --git a/.github/workflows/notif-push-to-slack.yml b/.github/workflows/notif-push-to-slack.yml new file mode 100644 index 0000000..ef2f830 --- /dev/null +++ b/.github/workflows/notif-push-to-slack.yml @@ -0,0 +1,35 @@ +#https://docs.github.com/en/webhooks/webhook-events-and-payloads#push +name: notify-push +on: + push: + branches: + - develop +jobs: + notify: + runs-on: ubuntu-latest + if: github.event.pusher.name == 'bigorn0' + env: + AUTHOR: ${{ github.event.pusher.name }} + steps: + - name: notify + run: echo "${AUTHOR}" + - name: notify slack + id: slack + uses: slackapi/slack-github-action@v1.26.0 + with: + channel-id: 'develop-direct-pushes' + payload: | + { + "text": " ${{ github.event.head_commit.url }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Direct push to develop: ${{ github.event.head_commit.url }}" + } + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}