Skip to content

Commit a82666c

Browse files
authored
Update everywhere to use new otelbot github app (#13256)
1 parent 86c7d9e commit a82666c

12 files changed

+99
-56
lines changed

.github/repository-settings.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ settings](https://github.com/open-telemetry/community/blob/main/docs/how-to-conf
8787
- Exclude:
8888
- `release/*`
8989
- `renovate/**/*`
90-
- `opentelemetrybot/**/*`
90+
- `otelbot/**/*`
9191
- `revert-*/**/*` (these are created when using the GitHub UI to revert a PR)
9292
- Restrict creations: CHECKED
9393

@@ -125,6 +125,8 @@ settings](https://github.com/open-telemetry/community/blob/main/docs/how-to-conf
125125

126126
### Organization secrets
127127

128-
- `OPENTELEMETRYBOT_GITHUB_TOKEN`
129-
- `OTELBOT_CLIENT_ID`
130128
- `OTELBOT_PRIVATE_KEY`
129+
130+
### Organization variables
131+
132+
- `OTELBOT_APP_ID`

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

+1
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,5 @@ echo "$contributors1" "$contributors2" \
8585
| grep -v github-actions \
8686
| grep -v renovate \
8787
| grep -v opentelemetrybot \
88+
| grep -v otelbot \
8889
| sed 's/^/@/'
+4
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

-4
This file was deleted.

.github/workflows/auto-update-otel-sdk.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
| sed 's/^v//')
3434
3535
matches=$(gh pr list \
36-
--author opentelemetrybot \
36+
--author otelbot \
3737
--state open \
3838
--search "in:title \"Update the OpenTelemetry SDK version to $latest_version\"")
3939
if [ ! -z "$matches" ]
@@ -62,9 +62,6 @@ jobs:
6262
VERSION: ${{ needs.check-versions.outputs.latest-version }}
6363
run: ./.github/scripts/update-sdk-version.sh $VERSION
6464

65-
- name: Use CLA approved github bot
66-
run: .github/scripts/use-cla-approved-github-bot.sh
67-
6865
- name: Free disk space
6966
run: .github/scripts/gha-free-disk-space.sh
7067

@@ -84,16 +81,25 @@ jobs:
8481
if: failure()
8582
run: git checkout -- licenses
8683

84+
- name: Use CLA approved bot
85+
run: .github/scripts/use-cla-approved-bot.sh
86+
87+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
88+
id: otelbot-token
89+
with:
90+
app-id: ${{ vars.OTELBOT_APP_ID }}
91+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
92+
8793
- name: Create pull request against main
8894
if: success() || failure()
8995
env:
9096
VERSION: ${{ needs.check-versions.outputs.latest-version }}
9197
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
92-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
98+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
9399
run: |
94100
message="Update the OpenTelemetry SDK version to $VERSION"
95101
body="Update the OpenTelemetry SDK version to \`$VERSION\`."
96-
branch="opentelemetrybot/update-opentelemetry-sdk-to-${VERSION}"
102+
branch="otelbot/update-opentelemetry-sdk-to-${VERSION}"
97103
98104
git checkout -b $branch
99105
git add -u

.github/workflows/backport.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,25 @@ jobs:
2626
# history is needed to run git cherry-pick below
2727
fetch-depth: 0
2828

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

35-
- name: Use CLA approved author
36-
run: |
37-
git config user.name otelbot
38-
git config user.email [email protected]
39-
4038
- name: Create pull request
4139
env:
4240
NUMBER: ${{ github.event.inputs.number }}
4341
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
44-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
42+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
4543
run: |
4644
commit=$(gh pr view $NUMBER --json mergeCommit --jq .mergeCommit.oid)
4745
title=$(gh pr view $NUMBER --json title --jq .title)
4846
49-
branch="opentelemetrybot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}"
47+
branch="otelbot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}"
5048
5149
git checkout -b $branch
5250
git cherry-pick $commit

.github/workflows/overhead-benchmark-daily.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949
cwd: "./gh-pages"
5050
branch: "gh-pages"
5151
message: "update test result data"
52-
author_name: opentelemetrybot
53-
author_email: 107717825+opentelemetrybot@users.noreply.github.com
54-
committer_name: opentelemetrybot
55-
committer_email: 107717825+opentelemetrybot@users.noreply.github.com
52+
author_name: otelbot
53+
author_email: 197425009+otelbot@users.noreply.github.com
54+
committer_name: otelbot
55+
committer_email: 197425009+otelbot@users.noreply.github.com
5656

5757
workflow-notification:
5858
permissions:

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

+10-4
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,22 @@ jobs:
4848
date=$(date "+%Y-%m-%d")
4949
sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md
5050
51-
- name: Use CLA approved github bot
52-
run: .github/scripts/use-cla-approved-github-bot.sh
51+
- name: Use CLA approved bot
52+
run: .github/scripts/use-cla-approved-bot.sh
53+
54+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
55+
id: otelbot-token
56+
with:
57+
app-id: ${{ vars.OTELBOT_APP_ID }}
58+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
5359

5460
- name: Create pull request
5561
env:
5662
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
57-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
63+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
5864
run: |
5965
message="Prepare release $VERSION"
60-
branch="opentelemetrybot/prepare-release-${VERSION}"
66+
branch="otelbot/prepare-release-${VERSION}"
6167
6268
git checkout -b $branch
6369
git commit -a -m "$message"

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

+20-8
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,22 @@ jobs:
6060
date=$(date "+%Y-%m-%d")
6161
sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md
6262
63-
- name: Use CLA approved github bot
64-
run: .github/scripts/use-cla-approved-github-bot.sh
63+
- name: Use CLA approved bot
64+
run: .github/scripts/use-cla-approved-bot.sh
65+
66+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
67+
id: otelbot-token
68+
with:
69+
app-id: ${{ vars.OTELBOT_APP_ID }}
70+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
6571

6672
- name: Create pull request against the release branch
6773
env:
6874
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
69-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
75+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
7076
run: |
7177
message="Prepare release $VERSION"
72-
branch="opentelemetrybot/prepare-release-${VERSION}"
78+
branch="otelbot/prepare-release-${VERSION}"
7379
7480
git checkout -b $branch
7581
git commit -a -m "$message"
@@ -111,17 +117,23 @@ jobs:
111117
date=$(date "+%Y-%m-%d")
112118
sed -Ei "s/^## Unreleased$/## Unreleased\n\n## Version $VERSION ($date)/" CHANGELOG.md
113119
114-
- name: Use CLA approved github bot
115-
run: .github/scripts/use-cla-approved-github-bot.sh
120+
- name: Use CLA approved bot
121+
run: .github/scripts/use-cla-approved-bot.sh
122+
123+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
124+
id: otelbot-token
125+
with:
126+
app-id: ${{ vars.OTELBOT_APP_ID }}
127+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
116128

117129
- name: Create pull request against main
118130
env:
119131
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
120-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
132+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
121133
run: |
122134
message="Update version to $NEXT_VERSION"
123135
body="Update version to \`$NEXT_VERSION\`."
124-
branch="opentelemetrybot/update-version-to-${NEXT_VERSION}"
136+
branch="otelbot/update-version-to-${NEXT_VERSION}"
125137
126138
git checkout -b $branch
127139
git commit -a -m "$message"

.github/workflows/release-update-cloudfoundry-index.yml

+15-9
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121

22-
- name: Use CLA approved github bot
23-
run: .github/scripts/use-cla-approved-github-bot.sh
24-
2522
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2623
with:
2724
ref: 'cloudfoundry'
2825

2926
- name: create working branch
30-
run: git checkout -b opentelemetrybot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }}
27+
run: git checkout -b otelbot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }}
3128

3229
- name: install xq (which is part of yq)
3330
run: |
@@ -42,19 +39,28 @@ jobs:
4239
- name: display changes
4340
run: git diff
4441

42+
- name: Use CLA approved bot
43+
run: .github/scripts/use-cla-approved-bot.sh
44+
45+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
46+
id: otelbot-token
47+
with:
48+
app-id: ${{ vars.OTELBOT_APP_ID }}
49+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
50+
4551
- name: create pr with repo changes
52+
env:
53+
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
54+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
4655
run: |
4756
git add index.yml
4857
if git diff-index --quiet --cached HEAD ; then
4958
echo "index.yml already current"
5059
exit 0
5160
fi
5261
git commit -m "Updated index.yml"
53-
git push --set-upstream origin opentelemetrybot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }}
62+
git push --set-upstream origin otelbot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }}
5463
gh pr create --base cloudfoundry \
55-
--head opentelemetrybot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }} \
64+
--head otelbot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }} \
5665
--title 'Release updates for Cloudfoundry Repo' \
5766
--body '[Created by Github action]'
58-
env:
59-
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
60-
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}

.github/workflows/release.yml

+21-9
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,20 @@ jobs:
215215
release_date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
216216
RELEASE_DATE=$release_date .github/scripts/merge-change-log-after-release.sh
217217
218-
- name: Use CLA approved github bot
219-
run: .github/scripts/use-cla-approved-github-bot.sh
218+
- name: Use CLA approved bot
219+
run: .github/scripts/use-cla-approved-bot.sh
220+
221+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
222+
id: otelbot-token
223+
with:
224+
app-id: ${{ vars.OTELBOT_APP_ID }}
225+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
220226

221227
- name: Create pull request against main
222228
env:
223229
VERSION: ${{ needs.release.outputs.version }}
224230
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
225-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
231+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
226232
run: |
227233
if git diff --quiet; then
228234
if [[ $VERSION == *.0 ]]; then
@@ -236,7 +242,7 @@ jobs:
236242
237243
message="Merge change log updates from $GITHUB_REF_NAME"
238244
body="Merge change log updates from \`$GITHUB_REF_NAME\`."
239-
branch="opentelemetrybot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
245+
branch="otelbot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
240246
241247
git checkout -b $branch
242248
git commit -a -m "$message"
@@ -254,9 +260,6 @@ jobs:
254260
with:
255261
ref: main
256262

257-
- name: Use CLA approved github bot
258-
run: .github/scripts/use-cla-approved-github-bot.sh
259-
260263
- name: Wait for release to be available in maven central
261264
env:
262265
VERSION: ${{ needs.release.outputs.version }}
@@ -279,15 +282,24 @@ jobs:
279282
./gradlew japicmp -PapiBaseVersion=$PRIOR_VERSION -PapiNewVersion=$VERSION
280283
./gradlew --refresh-dependencies japicmp
281284
285+
- name: Use CLA approved bot
286+
run: .github/scripts/use-cla-approved-bot.sh
287+
288+
- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
289+
id: otelbot-token
290+
with:
291+
app-id: ${{ vars.OTELBOT_APP_ID }}
292+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
293+
282294
- name: Create pull request against main
283295
env:
284296
VERSION: ${{ needs.release.outputs.version }}
285297
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
286-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
298+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
287299
run: |
288300
message="Update apidiff baseline to released version $VERSION"
289301
body="Update apidiff baseline to released version \`$version\`."
290-
branch="opentelemetrybot/update-apidiff-baseline-to-released-version-${VERSION}"
302+
branch="otelbot/update-apidiff-baseline-to-released-version-${VERSION}"
291303
292304
git checkout -b $branch
293305
git add docs/apidiffs

RELEASING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ and deadlocks.
4949
- Review and merge the backport pull request that it generates.
5050
- Note: if the PR contains any changes to workflow files, it will have to be manually backported,
5151
because the default `GITHUB_TOKEN` does not have permission to update workflow files (and the
52-
`opentelemetrybot` token doesn't have write permission to this repository at all, so while it
52+
`otelbot` token doesn't have write permission to this repository at all, so while it
5353
can be used to open a PR, it can't be used to push to a local branch).
5454
- Merge a pull request to the release branch updating the `CHANGELOG.md`.
5555
- The heading for the unreleased entries should be `## Unreleased`.

0 commit comments

Comments
 (0)