Skip to content

Commit d0bb873

Browse files
committed
Switch automation to use new otelbot GitHub App
1 parent e28de1a commit d0bb873

File tree

5 files changed

+45
-15
lines changed

5 files changed

+45
-15
lines changed

.github/workflows/backport.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,20 @@ jobs:
2626
# history is needed to run git cherry-pick below
2727
fetch-depth: 0
2828

29-
- name: Use CLA approved github bot
30-
run: .github/scripts/use-cla-approved-github-bot.sh
29+
- name: Use CLA approved bot
30+
run: .github/scripts/use-cla-approved-bot.sh
31+
32+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
33+
id: otelbot-token
34+
with:
35+
app-id: ${{ vars.OTELBOT_APP_ID }}
36+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
3137

3238
- name: Create pull request
3339
env:
3440
NUMBER: ${{ github.event.inputs.number }}
3541
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
36-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
42+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
3743
run: |
3844
commit=$(gh pr view $NUMBER --json mergeCommit --jq .mergeCommit.oid)
3945
title=$(gh pr view $NUMBER --json title --jq .title)

.github/workflows/prepare-patch-release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,19 @@ jobs:
4444
date=$(date "+%Y-%m-%d")
4545
sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md
4646
47-
- name: Use CLA approved github bot
48-
run: .github/scripts/use-cla-approved-github-bot.sh
47+
- name: Use CLA approved bot
48+
run: .github/scripts/use-cla-approved-bot.sh
49+
50+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
51+
id: otelbot-token
52+
with:
53+
app-id: ${{ vars.OTELBOT_APP_ID }}
54+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
4955

5056
- name: Create pull request
5157
env:
5258
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
53-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
59+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
5460
run: |
5561
message="Prepare release $VERSION"
5662
branch="opentelemetrybot/prepare-release-${VERSION}"

.github/workflows/prepare-release-branch.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,19 @@ jobs:
5656
date=$(date "+%Y-%m-%d")
5757
sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md
5858
59-
- name: Use CLA approved github bot
60-
run: .github/scripts/use-cla-approved-github-bot.sh
59+
- name: Use CLA approved bot
60+
run: .github/scripts/use-cla-approved-bot.sh
61+
62+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
63+
id: otelbot-token
64+
with:
65+
app-id: ${{ vars.OTELBOT_APP_ID }}
66+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
6167

6268
- name: Create pull request against the release branch
6369
env:
6470
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
65-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
71+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
6672
run: |
6773
message="Prepare release $VERSION"
6874
branch="opentelemetrybot/prepare-release-${VERSION}"
@@ -107,13 +113,19 @@ jobs:
107113
date=$(date "+%Y-%m-%d")
108114
sed -Ei "s/^## Unreleased$/## Unreleased\n\n## Version $VERSION ($date)/" CHANGELOG.md
109115
110-
- name: Use CLA approved github bot
111-
run: .github/scripts/use-cla-approved-github-bot.sh
116+
- name: Use CLA approved bot
117+
run: .github/scripts/use-cla-approved-bot.sh
118+
119+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
120+
id: otelbot-token
121+
with:
122+
app-id: ${{ vars.OTELBOT_APP_ID }}
123+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
112124

113125
- name: Create pull request against main
114126
env:
115127
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
116-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
128+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
117129
run: |
118130
message="Update version to $NEXT_VERSION"
119131
body="Update version to \`$NEXT_VERSION\`."

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,20 @@ jobs:
218218
release_date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
219219
RELEASE_DATE=$release_date .github/scripts/merge-change-log-after-release.sh
220220
221-
- name: Use CLA approved github bot
222-
run: .github/scripts/use-cla-approved-github-bot.sh
221+
- name: Use CLA approved bot
222+
run: .github/scripts/use-cla-approved-bot.sh
223+
224+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
225+
id: otelbot-token
226+
with:
227+
app-id: ${{ vars.OTELBOT_APP_ID }}
228+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
223229

224230
- name: Create pull request against main
225231
env:
226232
VERSION: ${{ needs.release.outputs.version }}
227233
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
228-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
234+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
229235
run: |
230236
if git diff --quiet; then
231237
if [[ $VERSION == *.0 ]]; then

0 commit comments

Comments
 (0)