Files
claude-code-action/scripts
8c07613f66 Use the default branch's config on pull requests from authors without write access (#2088)
* Use the default branch's config on pull requests from authors without write access

When a pull request's author does not have write access and it targets a branch
other than the default one, the config that the action restores now comes from
the base_branch input or the default branch instead of the pull request's base.
The base is still fetched so that the two can be compared.

Fetch and check out the config branch by its full ref name, so that a tag of the
same name or a narrow refspec can't leave the session without config.

Document that pr-N holds a fork's commits and should stay out of CI that holds
secrets.

Co-authored-by: mhegazy <[email protected]>

* Keep the other branch's config out of commits and the base comparable

The commit wrapper leaves out files that the action took from a branch other than
the pull request's base. HEAD's history is fetched again if fetching the config
branch cut it, and a base branch that can't be fetched fails the run as before.
A bot's pull request into a pr-N branch no longer takes its config from it.

Co-authored-by: mhegazy <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
2026-11-17 12:45:54 -08:00
..