From 168fd1f7f8afe953cc47b463d34d143bffe62d26 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 30 Jun 2022 13:50:36 -0700 Subject: [PATCH] Pass secret as input to compound action --- .../composite/announceFailedWorkflowInSlack/action.yml | 8 +++++++- .github/workflows/createNewVersion.yml | 2 ++ .github/workflows/deployBlocker.yml | 2 ++ .github/workflows/finishReleaseCycle.yml | 2 ++ .github/workflows/lockDeploys.yml | 2 ++ .github/workflows/platformDeploy.yml | 2 ++ .github/workflows/preDeploy.yml | 4 ++++ .github/workflows/updateProtectedBranch.yml | 2 ++ .github/workflows/warnCPLabel.yml | 2 ++ 9 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/actions/composite/announceFailedWorkflowInSlack/action.yml b/.github/actions/composite/announceFailedWorkflowInSlack/action.yml index 6a21642ad1ff..f6057d33f875 100644 --- a/.github/actions/composite/announceFailedWorkflowInSlack/action.yml +++ b/.github/actions/composite/announceFailedWorkflowInSlack/action.yml @@ -1,5 +1,11 @@ name: 'Announce failed workflow in Slack' description: 'Post failed workflow in Slack #announce channel' + +inputs: + SLACK_WEBHOOK: + description: 'URL of the slack webhook' + required: true + runs: using: composite steps: @@ -19,4 +25,4 @@ runs: } env: GITHUB_TOKEN: ${{ github.token }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + SLACK_WEBHOOK_URL: ${{ inputs.SLACK_WEBHOOK }} diff --git a/.github/workflows/createNewVersion.yml b/.github/workflows/createNewVersion.yml index 0d11d5e3ab93..12a0e82a24fb 100644 --- a/.github/workflows/createNewVersion.yml +++ b/.github/workflows/createNewVersion.yml @@ -76,3 +76,5 @@ jobs: - if: ${{ failure() }} uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/deployBlocker.yml b/.github/workflows/deployBlocker.yml index d21fe9809f23..b074b271a883 100644 --- a/.github/workflows/deployBlocker.yml +++ b/.github/workflows/deployBlocker.yml @@ -66,3 +66,5 @@ jobs: - if: ${{ failure() }} uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/finishReleaseCycle.yml b/.github/workflows/finishReleaseCycle.yml index f6ddc198f518..c5364d16242e 100644 --- a/.github/workflows/finishReleaseCycle.yml +++ b/.github/workflows/finishReleaseCycle.yml @@ -123,3 +123,5 @@ jobs: - if: ${{ failure() }} uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/lockDeploys.yml b/.github/workflows/lockDeploys.yml index b182c1a734e0..f1365223eaf8 100644 --- a/.github/workflows/lockDeploys.yml +++ b/.github/workflows/lockDeploys.yml @@ -31,3 +31,5 @@ jobs: - if: ${{ failure() }} uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 1bf682557149..3c85b57cee87 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -357,6 +357,8 @@ jobs: needs: [android, desktop, iOS, web] steps: - uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} postSlackMessageOnSuccess: name: Post a Slack message when all platforms deploy successfully diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index a3c852ea6f0a..e8d133a7a033 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -19,6 +19,8 @@ jobs: steps: - if: ${{ needs.lint.result == 'failure' || needs.test.result == 'failure' }} uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - if: ${{ needs.lint.result == 'failure' || needs.test.result == 'failure' }} run: exit 1 @@ -168,6 +170,8 @@ jobs: - if: ${{ failure() }} uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} # Check if actor is member of Expensify organization by looking for Expensify/expensify team isExpensifyEmployee: diff --git a/.github/workflows/updateProtectedBranch.yml b/.github/workflows/updateProtectedBranch.yml index 4be1b286cbb4..894b7b8e7fb9 100644 --- a/.github/workflows/updateProtectedBranch.yml +++ b/.github/workflows/updateProtectedBranch.yml @@ -136,3 +136,5 @@ jobs: - if: ${{ failure() }} uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/warnCPLabel.yml b/.github/workflows/warnCPLabel.yml index bad9fd6677f6..1d57ae38f718 100644 --- a/.github/workflows/warnCPLabel.yml +++ b/.github/workflows/warnCPLabel.yml @@ -21,3 +21,5 @@ jobs: - if: ${{ failure() }} uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main + with: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}