forked from elastic/elastic-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 2.13 KB
/
bump-agent-versions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
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"