Skip to content

Run pint in check mode for pull requests from forks - #143

Open
sadiqk2 wants to merge 1 commit into
NativePHP:mainfrom
sadiqk2:ci/pint-fork-pull-requests
Open

Run pint in check mode for pull requests from forks#143
sadiqk2 wants to merge 1 commit into
NativePHP:mainfrom
sadiqk2:ci/pint-fork-pull-requests

Conversation

@sadiqk2

@sadiqk2 sadiqk2 commented Aug 21, 2026

Copy link
Copy Markdown

php-code-styling fails on every pull request that comes from a fork, including #127, #128 and #136. It is not a code style problem, the job dies before Pint even runs:

[command]/usr/bin/git branch --list --remote origin/fix/security-cookie-config-namespace
[command]/usr/bin/git tag --list fix/security-cookie-config-namespace
##[error]A branch or tag with the name 'fix/security-cookie-config-namespace' could not be found

Two things are going on.

  1. The checkout passes ref: github.head_ref but no repository:, so it looks for the fork's branch inside this repository and cannot find it. build-plugin.yml already passes repository: ${{ github.event.pull_request.head.repo.full_name }}, this workflow was never given the same treatment.

  2. Even with the checkout fixed, the auto fix path cannot work for a fork. GITHUB_TOKEN has no write access to the contributor's fork, so git-auto-commit-action gets a 403 and the job fails again with a confusing error instead of a code style report.

This change:

  • adds repository: to the checkout, so the fork's branch is actually fetched
  • runs Pint in testMode for fork pull requests, so the job reports real style problems and passes when there are none
  • keeps the existing auto fix and commit behaviour for pull requests from branches in this repository

Behaviour for pushes and for internal branches is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant