Skip to content

Commit a2adb67

Browse files
committed
[chore] use otelbot GH app to update collector versions
1 parent edaf1aa commit a2adb67

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

.github/workflows/scripts/bump-versions.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ if [ "$commit_changes" = false ]; then
180180
exit 0
181181
fi
182182

183-
git config --global user.name "github-actions[bot]"
184-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
185-
186183
commit_changes() {
187184
local current_version=$1
188185
local next_version=$2

.github/workflows/update-version.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,31 @@ jobs:
2626
env:
2727
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
steps:
29+
- uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
30+
id: otelbot-token
31+
with:
32+
app-id: ${{ vars.OTELBOT_APP_ID }}
33+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
34+
35+
# The next 2 steps are taken from # from https://github.com/actions/create-github-app-token#create-a-git-committer-string-for-an-app-installation
36+
- name: Get GitHub App User ID
37+
id: get-user-id
38+
run: echo "user-id=$(gh api "/users/${{ steps.otelbot-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
39+
env:
40+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
41+
42+
- name: Set up commit author name and email
43+
id: committer
44+
run: |
45+
echo "name=${{ steps.otelbot-token.outputs.app-slug }}[bot]" >> "$GITHUB_OUTPUT"
46+
echo "email=${{ steps.get-user-id.outputs.user-id }}+${{ steps.otelbot-token.outputs.app-slug }}[bot]@users.noreply.github.com>" >> "$GITHUB_OUTPUT"
47+
git config --global user.name "$name"
48+
git config --global user.email "$email"
49+
2950
- name: Checkout repository
3051
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+
with:
53+
token: ${{ steps.otelbot-token.outputs.token }}
3154

3255
- name: Run bump-versions.sh
3356
run: |

0 commit comments

Comments
 (0)