Category: Automation

GitHub Actions: Secret Environment Variable Is Empty

Read this guide in Polish

Workflow shows an empty environment variable and the code reports no API key. The secret can be set in a bad view, environment or not made available to the event type.

How to determine the source of the error

Check the secret name, repo/organization/environment level, and assign a job to the environment.

Verify the PR event from the fork and permissions of the organization without writing the secret value in logs.

What to do step by step

1. Assign a secret to the proper repo and environment and set attendance control without revealing the key.

2 . For service integration, consider the OIDC as an alternative to long-term keys if the supplier supports it.

How to check the score

A trusted job sees void value and performs integration; unauthorised PR still has no access to it.

What to do

Do not publish token on the screen or in the error message for diagnosis.