From a9683f22e2427a1be55493c927bba87d9d45b0de Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 30 May 2024 11:52:32 +0200 Subject: [PATCH] github-actions: slack with GitHub secrets --- .github/workflows/release.yml | 16 ++++++---------- .github/workflows/snapshot.yml | 8 +++----- .github/workflows/update-specs.yml | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b0f4ff6..e85c6290 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -103,22 +103,18 @@ jobs: subject-path: "${{ github.workspace }}/**/target/*.jar" - if: ${{ success() }} - uses: elastic/apm-pipeline-library/.github/actions/slack-message@current + uses: elastic/oblt-actions/slack/send@v1.2.0 with: - url: ${{ secrets.VAULT_ADDR }} - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - channel: "#apm-agent-java" + bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + channel-id: "#apm-agent-java" message: | :runner: [${{ github.repository }}] Release *${{ github.ref_name }}* has been triggered in Buildkite: (<${{ steps.buildkite.outputs.build }}|build>) - if: ${{ failure() }} - uses: elastic/apm-pipeline-library/.github/actions/slack-message@current + uses: elastic/oblt-actions/slack/send@v1.2.0 with: - url: ${{ secrets.VAULT_ADDR }} - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - channel: "#apm-agent-java" + bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + channel-id: "#apm-agent-java" message: | :ghost: [${{ github.repository }}] Release *${{ github.ref_name }}* didn't get triggered in Buildkite. Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 554c5964..0cc21aba 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -73,12 +73,10 @@ jobs: subject-path: "${{ github.workspace }}/**/target/*.jar" - if: ${{ failure() }} - uses: elastic/apm-pipeline-library/.github/actions/slack-message@current + uses: elastic/oblt-actions/slack/send@v1.2.0 with: - url: ${{ secrets.VAULT_ADDR }} - roleId: ${{ secrets.VAULT_ROLE_ID }} - secretId: ${{ secrets.VAULT_SECRET_ID }} - channel: "#apm-agent-java" + bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + channel-id: "#apm-agent-java" message: | :ghost: [${{ github.repository }}] Snapshot *${{ github.ref_name }}* didn't get triggered in Buildkite. Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>) diff --git a/.github/workflows/update-specs.yml b/.github/workflows/update-specs.yml index 6b719dc6..d8376d8c 100644 --- a/.github/workflows/update-specs.yml +++ b/.github/workflows/update-specs.yml @@ -24,7 +24,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }} - if: failure() - uses: elastic/oblt-actions/slack/send@v1 + uses: elastic/oblt-actions/slack/send@v1.2.0 with: bot-token: ${{ secrets.SLACK_BOT_TOKEN }} channel-id: "#apm-agent-java"