2
2
name : update-agent-versions
3
3
4
4
on :
5
+ workflow_dispatch :
5
6
schedule :
6
7
- cron : " 0 0 * * *"
7
8
8
9
jobs :
9
10
update_versions :
10
11
runs-on : ubuntu-latest
12
+ permissions :
13
+ contents : write
14
+ pull-requests : write
11
15
steps :
12
- - name : Setup Git
13
- uses : elastic/apm-pipeline-library/.github/actions/setup-git@current
14
-
15
- - uses : elastic/apm-pipeline-library/.github/actions/github-token@current
16
- with :
17
- url : ${{ secrets.VAULT_ADDR }}
18
- roleId : ${{ secrets.VAULT_ROLE_ID }}
19
- secretId : ${{ secrets.VAULT_SECRET_ID }}
20
16
21
17
- name : Checkout
22
18
uses : actions/checkout@v4
@@ -42,24 +38,49 @@ jobs:
42
38
- name : Update versions
43
39
id : update
44
40
env :
45
- GH_TOKEN : ${{ env .GITHUB_TOKEN }}
41
+ GH_TOKEN : ${{ secrets .GITHUB_TOKEN }}
46
42
run : ./.github/workflows/bump-agent-versions.sh
47
43
48
- - if : ${{ failure() }}
49
- uses : elastic/apm-pipeline-library/. github/actions/slack-message@current
44
+ - if : ${{ failure() }}
45
+ uses : slackapi/slack- github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
50
46
with :
51
- url : ${{ secrets.VAULT_ADDR }}
52
- roleId : ${{ secrets.VAULT_ROLE_ID }}
53
- secretId : ${{ secrets.VAULT_SECRET_ID }}
54
- message : " :traffic_cone: Elastic Agent version update failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
55
- channel : " #ingest-notifications"
47
+ channel-id : ' #ingest-notifications'
48
+ payload : |
49
+ {
50
+ "text": "${{ env.SLACK_MESSAGE }}",
51
+ "blocks": [
52
+ {
53
+ "type": "section",
54
+ "text": {
55
+ "type": "mrkdwn",
56
+ "text": "${{ env.SLACK_MESSAGE }}"
57
+ }
58
+ }
59
+ ]
60
+ }
61
+ env :
62
+ SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
63
+ SLACK_MESSAGE : " :traffic_cone: Elastic Agent version update failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
56
64
57
65
# if a PR was created as a result of this job, we notify on the Slack channel
58
66
- if : ${{ startsWith(steps.update.outputs.pr, 'https') }}
59
- uses : elastic/apm-pipeline-library/. github/actions/slack-message@current
67
+ uses : slackapi/slack- github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
60
68
with :
61
- url : ${{ secrets.VAULT_ADDR }}
62
- roleId : ${{ secrets.VAULT_ROLE_ID }}
63
- secretId : ${{ secrets.VAULT_SECRET_ID }}
64
- message : " Update for Elastic Agent versions has been created: ${{ steps.update.outputs.pr }}"
65
- channel : " #ingest-notifications"
69
+ channel-id : ' #ingest-notifications'
70
+ payload : |
71
+ {
72
+ "text": "${{ env.SLACK_MESSAGE }}",
73
+ "blocks": [
74
+ {
75
+ "type": "section",
76
+ "text": {
77
+ "type": "mrkdwn",
78
+ "text": "${{ env.SLACK_MESSAGE }}"
79
+ }
80
+ }
81
+ ]
82
+ }
83
+ env :
84
+ SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
85
+ SLACK_MESSAGE : " Update for Elastic Agent versions has been created: ${{ steps.update.outputs.pr }}"
86
+
0 commit comments