Created
February 4, 2025 07:59
-
-
Save key/5ec158028fa48bf482acb25c7d553a1d to your computer and use it in GitHub Desktop.
Example workflow for Slack GitHub Action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/tmp-slack-github-action.yml | |
name: "[tmp] Slack GitHub Actions Debug" | |
on: | |
workflow_dispatch: | |
jobs: | |
send-to-slack: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
pull-requests: read | |
steps: | |
- name: Send GitHub Action data to a Slack workflow | |
uses: slackapi/[email protected] | |
with: | |
webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
webhook-type: incoming-webhook | |
payload: | | |
{ | |
"text": "plain 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": "blocks section :github: *bold* _italic_ ~strike~ GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment