From 58becced6a040ea40dc6afdf608d0c0b82b33bd3 Mon Sep 17 00:00:00 2001 From: Krystle Salazar Date: Fri, 15 Nov 2024 16:45:26 -0400 Subject: [PATCH] Move environment variables to slack action as input --- .github/workflows/ci_cd.yml | 5 ++--- .github/workflows/discussion_ping.yml | 4 ++-- .github/workflows/pr_limit_reminders.yml | 4 ++-- .github/workflows/pr_ping.yml | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b5a2a03a22b..000aa6f818a 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 ec2acbe5e07..5d2623024e5 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 e6877fab63f..68197d8e19f 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 7c5be96d4aa..55ba44091cc 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