Skip to content

Commit

Permalink
Update slack-webhook.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
lertsoft authored Dec 4, 2024
1 parent ced0629 commit 82bd8cf
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/slack-webhook.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
- name: Post a message in a channel

on:
workflow_call:
inputs:
workflow-event:
required: true
type: string
secrets:
slackWebhookUrl:
required: true

jobs:
notify:
name: PR notification
runs-on: [ubuntu-latest]
steps:
- name: Post message
uses: slackapi/slack-github-action@v1.25.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
payload: |
{
"title": ${{ toJson(fromJson(inputs.workflow-event).title) }},
"author": ${{ toJson(fromJson(inputs.workflow-event).user.login) }},
"link": ${{ toJson(fromJson(inputs.workflow-event).html_url) }}
}
uses: slackapi/slack-github-action@v2.0.0
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 }}"

0 comments on commit 82bd8cf

Please sign in to comment.