Category: Automation

GitHub Actions: Secrets Unavailable in Forked Pull Requests

Read this guide in Polish

The PR test from the outside fork does not see the secret, although the workflow main works properly. GitHub restricts untrusted workflow pull request access to sensitive secrets.

How to determine the source of the error

Check running event, branch origin and token permission level in this job.

Compare a safe test workflow with a deployment job using secrets.

What to do step by step

1. Separate tests performed without secrets from trusted implementation stages performed after approval.

2 . If you need to integrate into tests, use a limited environment or mots.

How to check the score

PR from the fork passes public tests without revealing secrets, and deploy only starts on a trusted code.

What to do

Do not use pull request target to execute untrusted code with authorized token.