update-agent-versions #34
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: ${{ success() && steps.update.output.pr == true}} | |
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 https://github.com/elastic/elastic-agent/pulls?q=is%3Aopen+is%3Apr+label%3Aupdate-versions" | |
channel: "#ingest-notifications" |