Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Fix workflows sending messages to Slack (#5168)

Krystle Salazar5b16cf15f18b
diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml
index b5a2a03a2..000aa6f81 100644
--- a/.github/workflows/ci_cd.yml
+++ b/.github/workflows/ci_cd.yml
@@ -1449,7 +1449,6 @@ jobs:
- name: Send report
uses: slackapi/slack-github-action@v2
with:
+ webhook: ${{ secrets.SLACK_OV_ALERTS_WEBHOOK_URL }}
+ webhook-type: incoming-webhook
payload: ${{ steps.report.outputs.payload }}
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_OV_ALERTS_WEBHOOK_URL }}
- SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
diff --git a/.github/workflows/discussion_ping.yml b/.github/workflows/discussion_ping.yml
index ec2acbe5e..5d2623024 100644
--- a/.github/workflows/discussion_ping.yml
+++ b/.github/workflows/discussion_ping.yml
@@ -16,13 +16,13 @@ jobs:
discussion_title: ${{ format('{0}', github.event.discussion.title) }}
discussion_author: ${{ github.event.discussion.user.login }}
discussion_repo: ${{ github.event.repository.full_name }}
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
steps:
- name: Send notification for new discussion
id: slack
uses: slackapi/slack-github-action@v2
with:
+ webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
+ webhook-type: incoming-webhook
payload: |
{
"text": "New discussion opened by ${{ env.discussion_author }} in ${{ env.discussion_repo }}: #${{ env.discussion_number }} - ${{ env.discussion_title }}",
diff --git a/.github/workflows/pr_limit_reminders.yml b/.github/workflows/pr_limit_reminders.yml
index e6877fab6..68197d8e1 100644
--- a/.github/workflows/pr_limit_reminders.yml
+++ b/.github/workflows/pr_limit_reminders.yml
@@ -33,8 +33,6 @@ jobs:
env:
pr_count: ${{ needs.analyze-user-prs.outputs.pr_count }}
slack_id: ${{ needs.analyze-user-prs.outputs.slack_id }}
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DM_WEBHOOK_URL }}
- SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
steps:
- name: Set required review count
run: |
@@ -43,6 +41,8 @@ jobs:
id: slack
uses: slackapi/slack-github-action@v2
with:
+ webhook: ${{ secrets.SLACK_DM_WEBHOOK_URL }}
+ webhook-type: incoming-webhook
# Note: We cannot use the YAML folded chomping block syntax here (`>`) because
# GitHub Actions does not support it (they only support a subset of YAML):
# https://github.com/actions/runner/issues/418#issuecomment-612928525
diff --git a/.github/workflows/pr_ping.yml b/.github/workflows/pr_ping.yml
index 7c5be96d4..55ba44091 100644
--- a/.github/workflows/pr_ping.yml
+++ b/.github/workflows/pr_ping.yml
@@ -19,8 +19,6 @@ jobs:
runs-on: ubuntu-latest
env:
EVENT_ACTION: ${{ github.event.action }}
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
steps:
- name: Write payload to file
uses: actions/github-script@v7
@@ -53,4 +51,6 @@ jobs:
- name: Send Slack notification
uses: slackapi/slack-github-action@v2
with:
+ webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
+ webhook-type: incoming-webhook
payload-file-path: /tmp/pr_ping_payload.json