Skip to content
Discussion options

You must be logged in to vote

hi @ghoststack-git

You’re on the right track with these best practices! Here are a few additional recommendations and nuances to consider:

Use pull_request_target carefully
While pull_request_target workflows run in the context of the base branch (so they have access to secrets), they also run with the code of the target branch, not the PR branch. This means if you run untrusted code (from a fork) in that context, it could exploit your secrets. Always combine this with manual approval or label-based gating before running jobs that use secrets.

Validate all inputs from PRs
If your workflow uses inputs or environment variables that originate from a PR, sanitize or whitelist them to prevent …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ghostinhershell
Comment options

Answer selected by ghoststack-git
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Scanning Code scanning: our code analysis features, powered by the CodeQL engine Code Security Build security into your GitHub workflow with features to keep your codebase secure Question Ask and answer questions about GitHub features and usage
4 participants