Skip to content

Commit 0e34a69

Browse files
authored
github-actions: remove apm-ci role/secret vault (#4790)
* github-actions: remove apm-ci role/secret vault * help with running it manually
1 parent c14df02 commit 0e34a69

File tree

1 file changed

+43
-22
lines changed

1 file changed

+43
-22
lines changed

.github/workflows/bump-agent-versions.yml

+43-22
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@
22
name: update-agent-versions
33

44
on:
5+
workflow_dispatch:
56
schedule:
67
- cron: "0 0 * * *"
78

89
jobs:
910
update_versions:
1011
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
1115
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 }}
2016

2117
- name: Checkout
2218
uses: actions/checkout@v4
@@ -42,24 +38,49 @@ jobs:
4238
- name: Update versions
4339
id: update
4440
env:
45-
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4642
run: ./.github/workflows/bump-agent-versions.sh
4743

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
5046
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 }}"
5664

5765
# if a PR was created as a result of this job, we notify on the Slack channel
5866
- 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
6068
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

Comments
 (0)