Category: Automation

GitHub Actions: environment secret empty despite the correct name

Read this guide in Polish

The secret is found in the production environment, but the job is not given its value.

How to identify the source of the problem

Check whether the job has assigned environment and whether the required reviewer has approved the deployment.

Check the workflow event type, permissions joba, run ID and first failed step.

Repair steps

Define the proper environment in the job and keep the rules of application for production secrets.

How to Test Solution

Once approved, the appropriate job can use a secret and regular PR does not receive it.

Security and restrictions

Apply minimum token privileges and re-impotence. Do not remove main branch protection only for the convenience of the machine.