Skip to content

Commit 95684ed

Browse files
authored
Merge branch 'main' into feat/golang-watcher
2 parents 2bcff0f + 8e5bf7c commit 95684ed

36 files changed

Lines changed: 7005 additions & 171 deletions

.github/workflows/build-explorer-database.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ jobs:
3939
pull-requests: write # Create or update the automated database-update PR
4040
runs-on: ubuntu-latest
4141
steps:
42-
- name: Checkout code
43-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44-
with:
45-
token: ${{ secrets.GITHUB_TOKEN }}
46-
# Persisted credentials are required so the later `git push -f origin
47-
# HEAD:${BRANCH}` step can authenticate.
48-
persist-credentials: true
49-
5042
- name: Detect repository type (if on a fork we use different git config)
5143
id: repo_check
5244
env:
@@ -58,19 +50,37 @@ jobs:
5850
echo "is_primary=false" >> $GITHUB_OUTPUT
5951
fi
6052
61-
- name: Configure git (primary repository)
62-
if: steps.repo_check.outputs.is_primary == 'true'
63-
run: |
64-
.github/scripts/use-cla-approved-bot.sh
65-
53+
# Mint the otelbot App token BEFORE checkout so it can be persisted as the
54+
# git credential. Pushes authenticated with the App token trigger
55+
# downstream workflows (e.g. CodeQL on the PR); pushes authenticated with
56+
# the default GITHUB_TOKEN do not, which previously left automated-update
57+
# PRs blocked waiting for code-scanning results after a branch update.
6658
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
6759
if: steps.repo_check.outputs.is_primary == 'true'
6860
id: otelbot-token
6961
with:
7062
app-id: ${{ vars.OTELBOT_APP_ID }}
7163
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
7264
repositories: ${{ github.event.repository.name }}
73-
permission-pull-requests: write
65+
permission-contents: write # Push the generated database to the update branch
66+
permission-pull-requests: write # Create or update the automated PR
67+
68+
- name: Checkout code
69+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
70+
with:
71+
# On the primary repo, persist the otelbot App token so the later
72+
# `git push -f origin HEAD:${BRANCH}` authenticates as the App and
73+
# triggers downstream workflows. Forks have no App secret and fall
74+
# back to GITHUB_TOKEN.
75+
token:
76+
${{ steps.repo_check.outputs.is_primary == 'true' && steps.otelbot-token.outputs.token
77+
|| secrets.GITHUB_TOKEN }}
78+
persist-credentials: true
79+
80+
- name: Configure git (primary repository)
81+
if: steps.repo_check.outputs.is_primary == 'true'
82+
run: |
83+
.github/scripts/use-cla-approved-bot.sh
7484
7585
- name: Configure git (fork)
7686
if: steps.repo_check.outputs.is_primary == 'false'

.github/workflows/nightly-registry-update.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ jobs:
3232
dotnet_result: ${{ steps.dotnet_instrumentation_watcher.outcome }}
3333
configuration_result: ${{ steps.configuration_watcher.outcome }}
3434
steps:
35-
- name: Checkout code
36-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37-
with:
38-
token: ${{ secrets.GITHUB_TOKEN }}
39-
# Persisted credentials are required so the later `git push -f origin
40-
# HEAD:${BRANCH}` step can authenticate.
41-
persist-credentials: true
42-
4335
- name: Detect repository type (if on a fork we use different git config)
4436
id: repo_check
4537
env:
@@ -51,19 +43,37 @@ jobs:
5143
echo "is_primary=false" >> $GITHUB_OUTPUT
5244
fi
5345
54-
- name: Configure git (primary repository)
55-
if: steps.repo_check.outputs.is_primary == 'true'
56-
run: |
57-
.github/scripts/use-cla-approved-bot.sh
58-
46+
# Mint the otelbot App token BEFORE checkout so it can be persisted as the
47+
# git credential. Pushes authenticated with the App token trigger
48+
# downstream workflows (e.g. CodeQL on the PR); pushes authenticated with
49+
# the default GITHUB_TOKEN do not, which previously left automated-update
50+
# PRs blocked waiting for code-scanning results after a branch update.
5951
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
6052
if: steps.repo_check.outputs.is_primary == 'true'
6153
id: otelbot-token
6254
with:
6355
app-id: ${{ vars.OTELBOT_APP_ID }}
6456
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
6557
repositories: ${{ github.event.repository.name }}
66-
permission-pull-requests: write
58+
permission-contents: write # Push registry updates to the update branch
59+
permission-pull-requests: write # Create or update the automated PR
60+
61+
- name: Checkout code
62+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
63+
with:
64+
# On the primary repo, persist the otelbot App token so the later
65+
# `git push -f origin HEAD:${BRANCH}` authenticates as the App and
66+
# triggers downstream workflows. Forks have no App secret and fall
67+
# back to GITHUB_TOKEN.
68+
token:
69+
${{ steps.repo_check.outputs.is_primary == 'true' && steps.otelbot-token.outputs.token
70+
|| secrets.GITHUB_TOKEN }}
71+
persist-credentials: true
72+
73+
- name: Configure git (primary repository)
74+
if: steps.repo_check.outputs.is_primary == 'true'
75+
run: |
76+
.github/scripts/use-cla-approved-bot.sh
6777
6878
- name: Configure git (forked repository)
6979
if: steps.repo_check.outputs.is_primary == 'false'

0 commit comments

Comments
 (0)