Skip to content

Commit f8a35a6

Browse files
committed
[ci] Dispatch tests after wiki pointer commits
1 parent c0519ed commit f8a35a6

5 files changed

Lines changed: 25 additions & 5 deletions

File tree

.github/workflows/wiki-preview.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
name: Update Wiki Preview
3838
runs-on: ubuntu-latest
3939
permissions:
40+
actions: write
4041
contents: write
4142
pull-requests: read
4243

@@ -110,6 +111,13 @@ jobs:
110111
pull: "--rebase --autostash"
111112
push: true
112113

114+
- name: Dispatch tests for wiki pointer commit
115+
if: steps.submodule_status.outputs.changed == 'true'
116+
env:
117+
GH_TOKEN: ${{ github.token }}
118+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
119+
run: gh workflow run tests.yml --ref "${HEAD_REF}" -f max-outdated=-1
120+
113121
- uses: ./.dev-tools-actions/.github/actions/summary/write
114122
with:
115123
markdown: |
@@ -118,3 +126,4 @@ jobs:
118126
- Preview branch: `${{ env.WIKI_PREVIEW_BRANCH }}`
119127
- Submodule pointer changed: `${{ steps.submodule_status.outputs.changed }}`
120128
- Parent repository pointer commit result: `${{ steps.submodule_status.outputs.changed == 'true' && 'updated' || 'unchanged' }}`
129+
- Tests dispatch result: `${{ steps.submodule_status.outputs.changed == 'true' && 'requested' || 'not needed' }}`

.github/workflows/wiki.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ concurrency:
1111
jobs:
1212
preview:
1313
permissions:
14+
actions: write
1415
contents: write
1516
pull-requests: read
1617
uses: ./.github/workflows/wiki-preview.yml

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Keep required PHPUnit matrix checks reporting after workflow-managed `.github/wiki` pointer commits by running the pull-request test workflow without top-level path filters and aligning the packaged consumer test wrapper (#230)
1313
- Ignore intentional Composer Dependency Analyser shadow dependency findings by default while adding `dependencies --show-shadow-dependencies` for audits (#233)
14+
- Dispatch the required test workflow after wiki preview automation updates a pull-request `.github/wiki` pointer, avoiding permanently pending required checks on bot-authored pointer commits (#230)
1415

1516
## [1.21.0] - 2026-04-24
1617

docs/advanced/branch-protection-and-bot-commits.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,15 @@ updates on PR branches while keeping ``main`` protected.
9999
Required test checks must still report for workflow-managed pointer commits.
100100
The tests workflow therefore triggers on every pull request update without
101101
top-level path filters. This ensures GitHub always creates the required
102-
``Run Tests`` matrix checks for the latest pull request head, including bot
103-
commits that only refresh ``.github/wiki``. Test workflow concurrency cancels
104-
older in-progress runs for the same pull request so the newest commit owns the
102+
``Run Tests`` matrix checks for ordinary pull request updates.
103+
104+
Workflow-managed ``.github/wiki`` pointer commits need one extra step. GitHub
105+
does not start another ``pull_request`` or ``push`` workflow run for commits
106+
pushed with the built-in workflow token. After the wiki preview workflow commits
107+
a parent-repository pointer update, it explicitly dispatches ``tests.yml`` for
108+
the pull request head branch so the newest bot-authored commit receives the
109+
required ``Run Tests`` matrix checks. Test workflow concurrency cancels older
110+
in-progress runs for the same pull request so the newest commit owns the
105111
required check contexts.
106112

107113
At a high level, the workflows need permission to read repository contents,
@@ -128,8 +134,9 @@ distinguish open pull requests from closed or merged ones before deleting
128134

129135
``wiki.yml`` is now preview-only, so its called workflow keeps
130136
``contents: write`` for wiki preview commits and parent-repository submodule
131-
pointer updates, while retaining ``pull-requests: read`` to inspect pull
132-
request metadata safely.
137+
pointer updates, ``actions: write`` to dispatch ``tests.yml`` after bot-authored
138+
pointer commits, and ``pull-requests: read`` to inspect pull request metadata
139+
safely.
133140

134141
``wiki-maintenance-entry.yml`` and ``wiki-maintenance.yml`` keep
135142
``contents: write`` for wiki publication and cleanup tasks, and

resources/github-actions/wiki.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
types: [opened, synchronize, reopened]
66

77
permissions:
8+
actions: write
89
contents: write
910
pull-requests: read
1011

@@ -15,6 +16,7 @@ concurrency:
1516
jobs:
1617
preview:
1718
permissions:
19+
actions: write
1820
contents: write
1921
pull-requests: read
2022
# Pull-request wiki previews live here. Publication and preview cleanup are

0 commit comments

Comments
 (0)