Skip to content

Commit

Permalink
github-actions: use GitHub secrets (#3565)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored May 21, 2024
1 parent 461c3ca commit 23883c4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 17 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/bump-elastic-stack-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,28 @@ jobs:
bump-elastic-stack:
runs-on: ubuntu-latest
needs: [filter]
permissions:
contents: write
pull-requests: write
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.filter.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: elastic/apm-pipeline-library/.github/actions/updatecli@current
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: ./.ci/bump-elastic-stack-snapshot.yml
notifySlackChannel: "#fleet-notifications"
messageIfFailure: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@fleet_team` please look what's going on <${{ env.JOB_URL }}|here>"
- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@9a37c7e35598d7b37d8e7568b40ed9538112be01 # v0.76.1

- name: Run Updatecli in Apply mode
run: updatecli --experimental apply --config .ci/bump-elastic-stack-snapshot.yml
env:
BRANCH: ${{ matrix.branch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ failure() }}
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
with:
channel-id: '#fleet-notifications'
payload: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@fleet_team` please look what's going on <${{ env.JOB_URL }}|here>"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
26 changes: 18 additions & 8 deletions .github/workflows/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@ env:
jobs:
bump:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
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 --experimental apply --config .ci/bump-golang.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- 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: ./.ci/bump-golang.yml
notifySlackChannel: "#ingest-notifications"
messageIfFailure: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@fleet_team` please look what's going on <${{ env.JOB_URL }}|here>"
channel-id: '#fleet-notifications'
payload: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@fleet_team` please look what's going on <${{ env.JOB_URL }}|here>"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit 23883c4

Please sign in to comment.