Skip to content

Update CI formatting workflow: fix checkout for forked pull requests#3266

Merged
C-Achard merged 2 commits intocy/centralize-test-workflowfrom
jaap/ci_remove_branch_ref
Mar 31, 2026
Merged

Update CI formatting workflow: fix checkout for forked pull requests#3266
C-Achard merged 2 commits intocy/centralize-test-workflowfrom
jaap/ci_remove_branch_ref

Conversation

@deruyter92
Copy link
Copy Markdown
Collaborator

Motivation:
This PR fixes CI checkout failures for forked pull requests by relying on the default GitHub ref behavior instead of forcing the PR head branch. See #3220 for an example

Details:
Updated format.yml (pre-commit workflow): changed the “Checkout PR branch” step to stop forcing ref: ${{ github.head_ref }}, so pre-commit runs against the PR merge ref that always exists on the CI runner’s repository.

@deruyter92 deruyter92 changed the base branch from main to cy/centralize-test-workflow March 31, 2026 09:41
@deruyter92 deruyter92 requested a review from C-Achard March 31, 2026 09:41
@deruyter92 deruyter92 added the CI Related to CI/CD jobs and automated testing label Mar 31, 2026
@deruyter92 deruyter92 added this to the CI Overhaul milestone Mar 31, 2026
@deruyter92 deruyter92 marked this pull request as ready for review March 31, 2026 13:06
Restrict the workflow to read-only access and prevent persisting checkout credentials. Adds permissions.contents: read and sets actions/checkout persist-credentials: false to avoid exposing the default GITHUB_TOKEN and set clear permissions.
Copy link
Copy Markdown
Collaborator

@C-Achard C-Achard left a comment

Choose a reason for hiding this comment

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

Thanks, this definitely helps!

Added some small tweaks to permissions, shouldn't change the runtime behavior.

@deruyter92
Copy link
Copy Markdown
Collaborator Author

@C-Achard, Good addition! Feel free to merge in your PR

@C-Achard C-Achard merged commit 3473f20 into cy/centralize-test-workflow Mar 31, 2026
3 checks passed
@C-Achard C-Achard deleted the jaap/ci_remove_branch_ref branch March 31, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Related to CI/CD jobs and automated testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants