update-agent-versions #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: update-agent-versions | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
update_versions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Git | |
uses: elastic/apm-pipeline-library/.github/actions/setup-git@current | |
- uses: elastic/apm-pipeline-library/.github/actions/github-token@current | |
with: | |
url: ${{ secrets.VAULT_ADDR }} | |
roleId: ${{ secrets.VAULT_ROLE_ID }} | |
secretId: ${{ secrets.VAULT_SECRET_ID }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# no depth limit | |
# so, we can generate snapshot versions based on release branches | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21 | |
- name: Set up branch | |
run: git checkout -b update-agent-versions-$GITHUB_RUN_ID | |
- name: Install mage | |
uses: magefile/mage-action@v3 | |
with: | |
version: v1.13.0 | |
install-only: true | |
- name: Update versions file | |
id: update | |
env: | |
GH_TOKEN: ${{ env.GITHUB_TOKEN }} | |
run: ./.github/workflows/bump-agent-versions.sh | |
- if: ${{ failure() }} | |
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current | |
with: | |
url: ${{ secrets.VAULT_ADDR }} | |
roleId: ${{ secrets.VAULT_ROLE_ID }} | |
secretId: ${{ secrets.VAULT_SECRET_ID }} | |
message: ":traffic_cone: Elastic Agent versions file update failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
channel: "#ingest-notifications" | |
# if a PR was created as a result of this job, we notify on the Slack channel | |
- if: ${{ startsWith(steps.update.outputs.pr, 'https') }} | |
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current | |
with: | |
url: ${{ secrets.VAULT_ADDR }} | |
roleId: ${{ secrets.VAULT_ROLE_ID }} | |
secretId: ${{ secrets.VAULT_SECRET_ID }} | |
message: "Update for Elastic Agent versions file has been created: ${{ steps.update.outputs.pr }}" | |
channel: "#ingest-notifications" |