Skip to content

Commit df5bc07

Browse files
authored
ci: use github secrets for GH token and Slack bot (#332)
1 parent 0b1aace commit df5bc07

File tree

2 files changed

+15
-29
lines changed

2 files changed

+15
-29
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,17 @@ jobs:
4747
steps:
4848
- id: notification
4949
name: Notify that a release will start
50-
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
50+
uses: elastic/oblt-actions/slack/send@v1
5151
with:
52-
url: ${{ secrets.VAULT_ADDR }}
53-
roleId: ${{ secrets.VAULT_ROLE_ID }}
54-
secretId: ${{ secrets.VAULT_SECRET_ID }}
55-
channel: "#apm-agent-mobile"
52+
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
53+
channel-id: "#apm-agent-mobile"
5654
message: |
5755
:runner: [${{ github.repository }}] Release *${{ github.ref_name }}* has been triggered with the following params:
5856
```${{ toJSON(github.event.inputs) }}```
5957
6058
- id: buildkite-run
6159
name: Run Release
62-
uses: elastic/oblt-actions/buildkite/run@v1.5.0
60+
uses: elastic/oblt-actions/buildkite/run@v1
6361
with:
6462
branch: ${{ github.ref_name }}
6563
pipeline: "apm-agent-android-release"
@@ -72,7 +70,7 @@ jobs:
7270
dry_run=${{ inputs.dry_run || 'false' }}
7371
TARBALL_FILE=${{ env.TARBALL_FILE }}
7472
75-
- uses: elastic/oblt-actions/buildkite/download-artifact@v1.5.0
73+
- uses: elastic/oblt-actions/buildkite/download-artifact@v1
7674
with:
7775
build-number: ${{ steps.buildkite-run.outputs.number }}
7876
path: ${{ env.TARBALL_FILE }}
@@ -93,15 +91,15 @@ jobs:
9391
subject-path: "${{ github.workspace }}/**/build/outputs/aar/*.aar"
9492

9593
- if: ${{ success() }}
96-
uses: elastic/oblt-actions/slack/send@v1.5.0
94+
uses: elastic/oblt-actions/slack/send@v1
9795
with:
9896
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
9997
channel-id: "#apm-agent-mobile"
10098
message: |
10199
:tada: :rocket: [${{ github.repository }}] Release *${{ github.ref_name }}* has been successful in Buildkite: (<${{ steps.buildkite-run.outputs.build }}|build>)
102100
103101
- if: ${{ failure() }}
104-
uses: elastic/oblt-actions/slack/send@v1.5.0
102+
uses: elastic/oblt-actions/slack/send@v1
105103
with:
106104
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
107105
channel-id: "#apm-agent-mobile"
@@ -114,21 +112,14 @@ jobs:
114112
runs-on: ubuntu-latest
115113
permissions:
116114
contents: write
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
117117
steps:
118-
- uses: elastic/apm-pipeline-library/.github/actions/github-token@current
119-
with:
120-
url: ${{ secrets.VAULT_ADDR }}
121-
roleId: ${{ secrets.VAULT_ROLE_ID }}
122-
secretId: ${{ secrets.VAULT_SECRET_ID }}
123-
- uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
124-
with:
125-
username: ${{ env.GIT_USER }}
126-
email: ${{ env.GIT_EMAIL }}
127-
token: ${{ env.GITHUB_TOKEN }}
128118
- uses: actions/checkout@v4
129119
with:
130120
ref: ${{ inputs.branch_specifier || 'main' }}
131121
token: ${{ env.GITHUB_TOKEN }}
122+
- uses: elastic/oblt-actions/git/setup@v1
132123
- uses: ./.github/actions/setup
133124
- if: ${{ ! inputs.dry_run }}
134125
run: ./gradlew postDeploy -Prelease=true -Pversion_override=${{ inputs.version_override_specifier || '' }}

.github/workflows/updateVersionBranch.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,15 @@ jobs:
1616
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'post-release/')
1717
runs-on: ubuntu-latest
1818
name: Create PR to update version branch
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
1921
steps:
20-
- uses: elastic/apm-pipeline-library/.github/actions/github-token@current
21-
with:
22-
url: ${{ secrets.VAULT_ADDR }}
23-
roleId: ${{ secrets.VAULT_ROLE_ID }}
24-
secretId: ${{ secrets.VAULT_SECRET_ID }}
25-
- uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
26-
with:
27-
username: ${{ env.GIT_USER }}
28-
email: ${{ env.GIT_EMAIL }}
29-
token: ${{ env.GITHUB_TOKEN }}
3022
- uses: actions/checkout@v4
3123
with:
3224
fetch-depth: 0
25+
26+
- uses: elastic/oblt-actions/git/setup@v1
27+
3328
- uses: actions-ecosystem/action-regex-match@v2
3429
id: major-version
3530
with:

0 commit comments

Comments
 (0)