Skip to content

Commit

Permalink
ci: use updatecli with GitHub secrets (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed May 28, 2024
1 parent dba6b9d commit e239405
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
7 changes: 3 additions & 4 deletions .ci/bump-opbeans-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ scms:
githubConfig:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: elastic
repository: opbeans-go
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: main

actions:
Expand All @@ -32,7 +31,7 @@ sources:
owner: "elastic"
repository: "apm-agent-go"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
versionFilter:
kind: regex
pattern: v(\d*)\.(\d*)\.(\d*)$
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/bump-opbeans-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ jobs:
cache: true
cache-dependency-path: '**/go.sum'

- uses: elastic/apm-pipeline-library/.github/actions/updatecli@current
- uses: elastic/oblt-actions/updatecli/run@v1
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: ./.ci/bump-opbeans-go.yml
command: "apply --config .ci/bump-opbeans-go.yml"
env:
GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }}

- if: failure()
uses: elastic/oblt-actions/slack/send@v1
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-agent-go"
message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"

0 comments on commit e239405

Please sign in to comment.