Repository navigation
Conversation
- omits having to use GH_TOKEN environment - omits having to invoke the `gh` CLI
|
ℹ️ Please back-port to other relevant branches as well |
There was a problem hiding this comment.
Pull request overview
This PR simplifies the nightly dispatcher workflows by switching from gh workflow run ... (and GH_TOKEN) to invoking the existing CI workflow as a reusable workflow.
Changes:
- Refactors
nightly-main.ymlandnightly-8.ymlto call./.github/workflows/ci.ymldirectly viauses:. - Makes
ci.ymlreusable by addingworkflow_call+ an optionalrefinput. - Updates the CI checkout step to use the provided
refinput.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/nightly-main.yml | Switches nightly main dispatch to a reusable workflow call. |
| .github/workflows/nightly-8.yml | Switches nightly 8 dispatch to a reusable workflow call with ref: '8'. |
| .github/workflows/ci.yml | Adds workflow_call support and uses a ref input for checkout. |
Comments suppressed due to low confidence (1)
.github/workflows/nightly-main.yml:12
nightly-mainpreviously always ran CI against themainbranch (explicit checkout +--ref main). Now the reusable workflow is invoked withoutref, so a manual run from another branch would test that branch instead ofmain. If the intent is to always validatemain, passwith: ref: 'main'(or hardcode the checkout ref inci.ymlwhen called from this workflow).
name: "dispatch-nightly-main"
uses: ./.github/workflows/ci.yml
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| - name: Checkout ${{ inputs.ref || '' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event_name == 'workflow_dispatch' && github.head_ref || '' }} | ||
| ref: ${{ inputs.ref || '' }} |
There was a problem hiding this comment.
inputs.ref is referenced unconditionally, but the inputs context is only populated for workflow_call / workflow_dispatch runs. Since this workflow still runs on push and pull_request, those events may fail at expression evaluation with an unrecognized context. Use github.event.inputs.ref (which safely resolves to empty when not present) or switch to a fallback like github.sha/github.ref without referencing inputs for non-call runs.
There was a problem hiding this comment.
Not an issue as far as I can measure: the pull_request CI run on this branch (run 22667295794) evaluated ${{ inputs.ref || '' }} and passed 4/4. The contexts docs describe inputs as available only in reusable or workflow_dispatch workflows, which leaves it empty elsewhere rather than failing. The suggested github.event.inputs.ref would break the nightly: in a called workflow the github context belongs to the caller (docs), so it would be empty for the schedule and nightly-8 would check out main.
| uses: ./.github/workflows/ci.yml | ||
| with: | ||
| ref: '8' |
There was a problem hiding this comment.
Behavior change vs the previous gh workflow run ci.yml --ref 8: this now runs the current branch's ci.yml definition (via local uses: ./.github/workflows/ci.yml) while checking out code from ref: '8'. If branch 8 expects a different CI workflow version, this will no longer match; consider calling a workflow from 8 (e.g., using uses: owner/repo/.github/workflows/ci.yml@8) or explicitly confirming that CI should be driven from main for the 8 branch.
There was a problem hiding this comment.
Good question. Why was the 8 branch test triggered from main before?
There was a problem hiding this comment.
Good question. Why was the
8branch test triggered frommainbefore?
SHORT: GH only supports scheduled workflows on the main branch.
LONG:
GH does support scheduled actions only on the main branch and the only way I found was to dispatch the workflow for the 8 branch that whay, but that needs the permission.
To be correct - dispatch the workflow using the workflow definition from that branch and not from 8.
uses: owner/repo/.github/workflows/ci.yml@8
That may work but needs to be verified that it works using the ci.yaml from branch 8 and not main. I was not aware of that branch ref syntax.
There was a problem hiding this comment.
Confirming the concern with numbers, and on the @8 idea:
- With
./the called file comes from the caller's commit, i.e. main (docs). Branch 8 would lose its PHP 8.1 cell (main: 8.2-8.5, branch 8: 8.1-8.5,php: ^8.1), and that is exactly the cell failing every night since 2026-10-16. TYPO3/testing-framework/.github/workflows/ci.yml@8would use branch 8's file, but only works ifci.ymlon8getson: workflow_call(it currently haspush,pull_request,workflow_dispatch).- It still needs
with: ref: '8'and theinputs.refcheckout on that branch: in a called workflow thegithubcontext is the caller's (docs), so a checkout without ref would fetchmain.
I have not run the @8 variant; it would need one manual dispatch to confirm which SHA and matrix end up running.
CybotTM
left a comment
There was a problem hiding this comment.
Requesting changes: for main this is equivalent to today, but for branch 8 the nightly would run main's ci.yml and stop testing PHP 8.1, which is the cell that currently fails every night. The PR also conflicts with main in all three files.
- Branch 8 loses PHP 8.1.
uses: ./.github/workflows/ci.ymlloads the called workflow "from the same commit as the caller workflow" (docs), and scheduled workflows "run on the latest commit on the default branch" (docs). So branch 8 would be tested with main's matrix 8.2-8.5 and main's step conditions instead of its own 8.1-8.5 (composer.jsonthere:php: ^8.1). CGL would move from 8.1 to 8.2/8.3, phpstan from 8.2-8.5 to 8.2/8.3. The dispatched CI on 8 has failed every night since 2026-10-16: onlyall tests (8.1)fails at "Composer install" (typo3/cms-core 12.x blocked by security advisories on enshrined/svg-sanitize), fail-fast cancels the rest. With this PR the nightly would turn green without that being fixed. - Rebase needed. Conflicts in
ci.yml,nightly-8.ymlandnightly-main.ymlagainst current main. Resolvingci.ymltowards this branch would drop main'sactions/checkout@v6,ubuntu-24.04and the-b dockerchange from b0814df; only theworkflow_call/permissionshunk and the checkoutrefhunk need to be carried over. nightly-9.ymlis not covered. It was added on main after this branch (a7a71dc) and still uses theghdispatcher.- Please run the new path once before merging (manual dispatch of the nightly workflows on this branch). The only run on this head is the
pull_requestCI run; theworkflow_callpath has never run.
Options for 8 and 9: keep the gh workflow run dispatcher there, which works today, or add workflow_call with a ref input to ci.yml on 8 and 9 and call TYPO3/testing-framework/.github/workflows/ci.yml@8 with ref: '8' (details in the thread on nightly-8.yml).
Checked and fine
mainnightly: same workflow file and code as today.push,pull_request,workflow_dispatchruns ofci.yml: the old checkout expression was always''(github.head_refis only set for pull request events), the newinputs.refis''as well; thepull_requestrun on this head passed 4/4.- Dropping
actions: writeandGH_TOKENand addingpermissions: contents: read: no step needs more than read. - The nightly run now carries the test result itself; today the dispatcher stays green while CI on 8 is red.
- Nit:
nightly-main.ymlhas no newline at end of file.
ghCLI