Overview
You may want to use context to share environment variable across projects. However, when you build pull requests from forked repositories, the user who triggered the build often is not a member of the organization that the project is running under in CircleCI. Therefore, you will see an Authorization error in the CircleCI UI and the build will not run.
Resolutions:
Re-run the failed build
You can have a user with the correct permission re-run the build. This will use the permissions of the user re-ran the build. Please note that the user still needs to be a member of the assigned security group within the organization.
Hold the workflow for manual approval
You can hold the workflow for manual approval by a user with the correct permissions to the context. This means that workflow will remain on-hold until it is approved.
Use project level environment variables
In order to share environment variables with forked repositories you will need to enable the Pass secrets to builds from forked pull requests feature from your project settings > advanced.
Comments
Article is closed for comments.