fix: use pull_request_target for PR automation to fix Dependabot secret access - #5922
Closed
JeffreyDallas wants to merge 1 commit into
Closed
fix: use pull_request_target for PR automation to fix Dependabot secret access#5922JeffreyDallas wants to merge 1 commit into
JeffreyDallas wants to merge 1 commit into
Conversation
…et access Dependabot-triggered pull_request runs get a read-only GITHUB_TOKEN and no repository secrets, so secrets.GH_ACCESS_TOKEN resolved empty and the github-script step failed with "Input required and not supplied: github-token". Neither job checks out PR code, so running via pull_request_target is safe and restores secret access for Dependabot PRs. Fixes #5921 Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
Contributor
Contributor
nathanklick
requested changes
Aug 28, 2026
nathanklick
left a comment
Contributor
There was a problem hiding this comment.
This is not the appropriate way to handle this as this opens security vulnerabilities.
The proper way is to add the secrets needed to the repository level dependabot secrets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request changes the following:
pull_requesttrigger on.github/workflows/zxf-prs-automation.yaml(pr-automationandauto-assign-merge-queuejobs) topull_request_target. GitHub Actions withholds repository secrets and downgradesGITHUB_TOKENto read-only for workflow runs triggered by Dependabot onpull_request, which causedsecrets.GH_ACCESS_TOKENto resolve empty and theactions/github-scriptstep to fail withInput required and not supplied: github-token. Neither job checks out PR code, so running viapull_request_target(base-repo context) is safe and restores secret access for Dependabot-triggered runs.prEventNameslist and theauto-assign-merge-queuejob'sif:condition frompull_requesttopull_request_targetto match the newcontext.eventName/github.event_namevalue, so single-PR processing (rather than a full open-PR scan) still triggers correctly.Related Issues
Pull request (PR) checklist
package.jsonchanges have been explained to and approved by a repository managerTesting
The following manual testing was done:
context.eventName/github.event_nameusages in the workflow's script and jobif:conditions to confirm they were updated consistently with the trigger rename.The following was not tested:
Commit message guidelines
We use 'Conventional Commits' to ensure that our commit messages are easy to read, follow a consistent format, and for automated release note generation. Please follow the guidelines below when writing your commit messages: