From 76573dec80abf45720eb876ba6ca1794d88b8e41 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 21 May 2024 21:36:49 +0200 Subject: [PATCH] github-actions: use GitHub secrets (#4786) --- .github/workflows/bump-golang.yml | 41 +++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bump-golang.yml b/.github/workflows/bump-golang.yml index 4127cea9e4f..ebeb1a74026 100644 --- a/.github/workflows/bump-golang.yml +++ b/.github/workflows/bump-golang.yml @@ -14,15 +14,40 @@ env: jobs: bump: + permissions: + contents: write + pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: elastic/apm-pipeline-library/.github/actions/updatecli@current + - name: Install Updatecli in the runner + uses: updatecli/updatecli-action@9a37c7e35598d7b37d8e7568b40ed9538112be01 # v0.76.1 + + - name: Run Updatecli in Apply mode + run: updatecli apply --config .github/updatecli-bump-golang.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_USER: "github-actions[bot]" + GIT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com" + + - if: ${{ failure() }} + uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 with: - vaultUrl: ${{ secrets.VAULT_ADDR }} - vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} - vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} - pipeline: ./.github/updatecli-bump-golang.yml - notifySlackChannel: "#ingest-notifications" - messageIfFailure: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@agent-team` please look what's going on <${{ env.JOB_URL }}|here>" + channel-id: '#ingest-notifications' + payload: | + { + "text": "${{ env.SLACK_MESSAGE }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ env.SLACK_MESSAGE }}" + } + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@agent-team` please look what's going on <${{ env.JOB_URL }}|here>"