Skip to content

Commit da490c4

Browse files
authored
Switch automation to use new otelbot GitHub App (#1721)
1 parent 36ab34f commit da490c4

File tree

7 files changed

+55
-24
lines changed

7 files changed

+55
-24
lines changed

.github/scripts/generate-release-contributors.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,5 @@ echo $contributors1 $contributors2 \
8888
| grep -v dependabot \
8989
| grep -v renovate \
9090
| grep -v opentelemetrybot \
91+
| grep -v otelbot \
9192
| sed 's/^/@/'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash -e
2+
3+
git config user.name otelbot
4+
git config user.email [email protected]

.github/scripts/use-cla-approved-github-bot.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/backport.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,25 @@ 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)
4046
41-
branch="opentelemetrybot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}"
47+
branch="otelbot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}"
4248
4349
git checkout -b $branch
4450
git cherry-pick $commit

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,22 @@ 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"
56-
branch="opentelemetrybot/prepare-release-${VERSION}"
62+
branch="otelbot/prepare-release-${VERSION}"
5763
5864
git checkout -b $branch
5965
git commit -a -m "$message"

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,22 @@ 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"
68-
branch="opentelemetrybot/prepare-release-${VERSION}"
74+
branch="otelbot/prepare-release-${VERSION}"
6975
7076
git checkout -b $branch
7177
git commit -a -m "$message"
@@ -107,17 +113,23 @@ 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\`."
120-
branch="opentelemetrybot/update-version-to-${NEXT_VERSION}"
132+
branch="otelbot/update-version-to-${NEXT_VERSION}"
121133
122134
git checkout -b $branch
123135
git commit -a -m "$message"

.github/workflows/release.yml

Lines changed: 10 additions & 4 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
@@ -239,7 +245,7 @@ jobs:
239245
240246
message="Merge change log updates from $GITHUB_REF_NAME"
241247
body="Merge log updates from \`$GITHUB_REF_NAME\`."
242-
branch="opentelemetrybot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
248+
branch="otelbot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
243249
244250
git checkout -b $branch
245251
git commit -a -m "$message"

0 commit comments

Comments
 (0)