Skip to content

Commit 2885255

Browse files
committed
Only sync back versions on Dependabot update PRs
1 parent e9d7b2d commit 2885255

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/rebuild.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
if: github.event.label.name == 'Rebuild' || github.event_name == 'workflow_dispatch'
1313

14+
env:
15+
HEAD_REF: ${{ github.event.pull_request.head.ref || github.event.ref }}
16+
BASE_BRANCH: ${{ github.event.pull_request.base.ref || 'main' }}
17+
1418
permissions:
1519
contents: write # needed to push rebuilt commit
1620
pull-requests: write # needed to comment on the PR
@@ -19,7 +23,7 @@ jobs:
1923
uses: actions/checkout@v5
2024
with:
2125
fetch-depth: 0
22-
ref: ${{ github.event.pull_request.head.ref || github.event.ref }}
26+
ref: ${{ env.HEAD_REF }}
2327

2428
- name: Remove label
2529
if: github.event_name == 'pull_request'
@@ -37,8 +41,6 @@ jobs:
3741
3842
- name: Merge in changes from base branch
3943
id: merge
40-
env:
41-
BASE_BRANCH: ${{ github.event.pull_request.base.ref || 'main' }}
4244
run: |
4345
git fetch origin "$BASE_BRANCH"
4446
@@ -73,6 +75,8 @@ jobs:
7375
python-version: 3.11
7476

7577
- name: Sync back version updates to generated workflows
78+
# Only sync back versions on Dependabot update PRs
79+
if: startsWith(env.HEAD_REF, 'dependabot/')
7680
working-directory: pr-checks
7781
run: |
7882
python3 sync_back.py -v

0 commit comments

Comments
 (0)