What's changed
Seasons greeting! 🎃 This pre-release tags some of the ongoing changes on the v2-development
branch for testing and experiments with actual workflows.
The release includes numerous and significant breaking changes for all techniques, and for now we recommend reading the README.md
to discover what's changed for the techniques you're using. A more detailed migration guide will soon follow! 📚
⚠️ An issue has been found related to loading ES modules when using this GitHub Action. A following release candidate plans to address this soon!
Previewing a few of these changes
As a glance into how the different techniques function, the following snippets might be useful. With all of these changes, please note the version used in the GitHub step:
uses: slackapi/slack-github-action@v2.0.0-rc.1
This is the same version that's required when experimenting with this pre-release!
Technique 1: Slack Workflow Builder
This technique uses a webhook trigger to start a Slack workflow in Workflow Builder:
- name: Send GitHub Action data to a Slack workflow
uses: slackapi/slack-github-action@v2.0.0-rc.1
with:
payload-delimiter: "_"
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
Technique 2: Slack API method
This technique uses a provided token and one of the Slack API methods to send data:
- name: Post to a Slack channel
uses: slackapi/slack-github-action@v2.0.0-rc.1
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }}
text: "howdy <@channel>!"
Technique 3: Slack incoming webhook
This technique posts a message to a channel using incoming webhooks:
- name: Post a message in a channel
uses: slackapi/slack-github-action@v2.0.0-rc.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "*GitHub Action build result*: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
blocks:
- type: "section"
text:
type: "mrkdwn"
text: "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
Sharing feedback
As development reaches more stable commits, your feedback and findings in these tagged changes is so important! Please feel free to report an issue or leave a comment if something doesn't seem right. We're hoping this rollout won't be a spooky one! 👻