Skip to content

Commit 54a6994

Browse files
authored
Use otelbot-java-instrumentation for metadata update workflow (#15555)
1 parent 30f4761 commit 54a6994

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

.github/workflows/metadata-update.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ jobs:
2121
pull-requests: write # for adding label and assignee to PR
2222

2323
steps:
24+
- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
25+
id: otelbot-token
26+
with:
27+
app-id: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_APP_ID }}
28+
private-key: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_PRIVATE_KEY }}
29+
2430
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
31+
with:
32+
token: ${{ steps.otelbot-token.outputs.token }}
2533

2634
- name: Free disk space
2735
run: .github/scripts/gha-free-disk-space.sh
@@ -55,27 +63,16 @@ jobs:
5563
if: steps.diffcheck.outputs.has_diff == 'true'
5664
run: .github/scripts/use-cla-approved-bot.sh
5765

58-
- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
59-
if: steps.diffcheck.outputs.has_diff == 'true'
60-
id: otelbot-token
61-
with:
62-
app-id: ${{ vars.OTELBOT_APP_ID }}
63-
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
64-
6566
- name: Find or create metadata update branch
6667
if: steps.diffcheck.outputs.has_diff == 'true'
6768
id: findbranch
68-
env:
69-
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
7069
run: |
7170
BRANCH_NAME="otelbot/metadata-update-main"
7271
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
7372
git checkout -B "$BRANCH_NAME"
7473
7574
- name: Commit and push changes
7675
if: steps.diffcheck.outputs.has_diff == 'true'
77-
env:
78-
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
7976
run: |
8077
BRANCH_NAME="${{ steps.findbranch.outputs.branch }}"
8178
git commit -m "chore: update instrumentation list [automated]" || echo "No changes to commit."
@@ -104,7 +101,7 @@ jobs:
104101
- name: Add label to PR
105102
if: steps.createpr.outputs.new_pr == 'true'
106103
env:
107-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
108105
run: |
109106
BRANCH_NAME="${{ steps.findbranch.outputs.branch }}"
110107
PR_URL=$(gh pr list --state open --head "$BRANCH_NAME" --json url -q '.[0].url')

0 commit comments

Comments
 (0)