Skip to content

Commit

Permalink
github-actions: use GitHub secrets (#4786)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored May 21, 2024
1 parent 921fd1b commit 76573de
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions .github/workflows/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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>"

0 comments on commit 76573de

Please sign in to comment.