Skip execution job when secret is absent#783
Open
mendral-app[bot] wants to merge 1 commit intomainfrom
Open
Conversation
Add job-level `if: ${{ secrets.NOTTE_API_KEY != '' }}` condition to the
execution job in the snippets-python-tests workflow. This prevents the
job from failing on fork PRs where GitHub does not inject repository
secrets, replacing false-red failures with a clean skip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
executionjob in thesnippets-python-testsworkflow whenNOTTE_API_KEYis not available (e.g., on fork PRs), replacing false-red failures with a clean skipif: ${{ secrets.NOTTE_API_KEY != '' }}condition — the simplest and most idiomatic way to gate a job on secret availabilityProblem
The
executionjob fails onpull_requestevents from forks because GitHub Actions does not inject repository secrets for fork PRs. The "Verify environment variables" step detects the emptyNOTTE_API_KEYand exits with code 1, causing 4 false-red PR check failures over the past 14 days.Related insight: execution job fails on PRs: NOTTE_API_KEY secret not injected
Change
In
.github/workflows/docs-tests-cicd.yml, added a job-level condition to theexecutionjob:When the secret is absent, the job is cleanly skipped (shows as "Skipped" in the GitHub Actions UI) instead of failing. When the secret is present (push to main, internal PRs), the job runs as before.
Note
Created by Mendral. Tag @mendral-app with feedback or questions.
Greptile Summary
Adds
if: ${{ secrets.NOTTE_API_KEY != '' }}to theexecutionjob in.github/workflows/docs-tests-cicd.ymlso the job is cleanly skipped on fork PRs where GitHub does not inject repository secrets, instead of failing at the "Verify environment variables" step.Confidence Score: 5/5
Safe to merge — minimal, correct change with no functional risk.
Single-line idiomatic GitHub Actions condition; no logic changes to test steps or other jobs. No P0/P1 findings.
No files require special attention.
Important Files Changed
ifcondition to skip theexecutionjob whenNOTTE_API_KEYis absent, preventing false-red failures on fork PRs.Reviews (1): Last reviewed commit: "ci: skip execution job when NOTTE_API_KE..." | Re-trigger Greptile