Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .github/workflows/metadata-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ jobs:
pull-requests: write # for adding label and assignee to PR

steps:
- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
id: otelbot-token
with:
app-id: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_APP_ID }}
private-key: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_PRIVATE_KEY }}

- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
token: ${{ steps.otelbot-token.outputs.token }}
Comment on lines 30 to +32
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what fixes the pushes to existing PRs to trigger workflows


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

- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
if: steps.diffcheck.outputs.has_diff == 'true'
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: Find or create metadata update branch
if: steps.diffcheck.outputs.has_diff == 'true'
id: findbranch
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
run: |
BRANCH_NAME="otelbot/metadata-update-main"
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
git checkout -B "$BRANCH_NAME"
- name: Commit and push changes
if: steps.diffcheck.outputs.has_diff == 'true'
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
Comment on lines -68 to -78
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these aren't needed

run: |
BRANCH_NAME="${{ steps.findbranch.outputs.branch }}"
git commit -m "chore: update instrumentation list [automated]" || echo "No changes to commit."
Expand Down Expand Up @@ -104,7 +101,7 @@ jobs:
- name: Add label to PR
if: steps.createpr.outputs.new_pr == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was ok but just changed for consistency since using that token already

run: |
BRANCH_NAME="${{ steps.findbranch.outputs.branch }}"
PR_URL=$(gh pr list --state open --head "$BRANCH_NAME" --json url -q '.[0].url')
Expand Down
Loading