A GitHub Action to push a slack webhook
This action suits the deploy on new tag workflow.
On your release workflow, this action will post to Slack the version, a link to the workflow and the changelog (if your changelog follows this format).
Go to Slack's app manager, create a new app with an incoming webhook for the channel you want, copy the URL, that's your slack_webhook_url
. If you want to make it pretty, there's an icon in this repository you can give to your app.
The version you're releasing (e.g. v1.0.1, 1.0.1)
Optional, the contents of your changelog file.
Each version needs to start with ## x.y.z
Your slack webhook URL
- name: Get changelog
id: changelog
shell: bash
# trick for multiline variables
run: |
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$(head -100 HISTORY.md)" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Get version
id: version
run: echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
- name: Notify on Slack
uses: bloodyowl/slack-message-release-action@v1.1.5
with:
version: ${{ steps.version.outputs.version }}
changelog: ${{ steps.changelog.outputs.changelog }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}