Skip to content

Commit

Permalink
Try using the slackapi/slack GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
JanneKiiskila committed Jul 4, 2024
1 parent eac77d9 commit 18281f1
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,24 @@ jobs:
run: go build ./...
- name: Run make.sh test (go vet + go test)
run: ./make.sh test
- name: Post status to Slack testing_builds
if: always()
uses: act10ns/slack@v2
- name: Send build status to Slack channel
id: slack
uses: slackapi/slack[email protected]
with:
status: ${{ job.status }}
channel: '#testing_builds'
# For posting a rich message using Block Kit
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 }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

0 comments on commit 18281f1

Please sign in to comment.