Skip to content

Commit 2c2dcdb

Browse files
committed
Fix Slack notification workflows: use org-standard incoming-webhook pattern
1 parent 0d672e9 commit 2c2dcdb

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

.github/workflows/slack-issue-notification.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Send issue details to Slack
15-
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
15+
uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
1616
with:
17-
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
18-
webhook-type: webhook-trigger
17+
webhook: ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
18+
webhook-type: incoming-webhook
1919
payload: |
20-
issue_title: "${{ github.event.issue.title }}"
21-
issue_number: "${{ github.event.issue.number }}"
22-
issue_url: "${{ github.event.issue.html_url }}"
23-
issue_author: "${{ github.event.issue.user.login }}"
24-
issue_body: ${{ toJSON(github.event.issue.body) }}
25-
repository: "${{ github.repository }}"
26-
created_at: "${{ github.event.issue.created_at }}"
20+
{ "text": ${{ toJSON(format(':inbox_tray: *New issue in {0}*: #{1} {2} (by {3})\n{4}', github.repository, github.event.issue.number, github.event.issue.title, github.event.issue.user.login, github.event.issue.html_url)) }} }

.github/workflows/slack-open-prs-notification.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ jobs:
4040
);
4141
4242
- name: Send open PRs summary to Slack
43-
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
43+
uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
4444
with:
45-
webhook: ${{ secrets.SLACK_OPEN_PRS_WEBHOOK_URL }}
46-
webhook-type: webhook-trigger
45+
webhook: ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
46+
webhook-type: incoming-webhook
4747
payload: |
48-
pr_count: "${{ steps.open-prs.outputs.count }}"
49-
pr_list: ${{ toJSON(steps.open-prs.outputs.pr_list) }}
50-
repository: "${{ github.repository }}"
51-
repository_url: "https://github.com/${{ github.repository }}/pulls"
48+
{ "text": ${{ toJSON(format(':bar_chart: *Open PRs in {0}* ({1}): https://github.com/{0}/pulls\n{2}', github.repository, steps.open-prs.outputs.count, steps.open-prs.outputs.pr_list)) }} }

0 commit comments

Comments
 (0)