Skip to content

Skip execution job when secret is absent#783

Open
mendral-app[bot] wants to merge 1 commit intomainfrom
mendral/skip-execution-when-secret-absent
Open

Skip execution job when secret is absent#783
mendral-app[bot] wants to merge 1 commit intomainfrom
mendral/skip-execution-when-secret-absent

Conversation

@mendral-app
Copy link
Copy Markdown

@mendral-app mendral-app Bot commented Apr 23, 2026

Summary

  • Skip the execution job in the snippets-python-tests workflow when NOTTE_API_KEY is not available (e.g., on fork PRs), replacing false-red failures with a clean skip
  • Adds a job-level if: ${{ secrets.NOTTE_API_KEY != '' }} condition — the simplest and most idiomatic way to gate a job on secret availability

Problem

The execution job fails on pull_request events from forks because GitHub Actions does not inject repository secrets for fork PRs. The "Verify environment variables" step detects the empty NOTTE_API_KEY and 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 the execution job:

execution:
  needs: type-check
  if: ${{ secrets.NOTTE_API_KEY != '' }}

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 the execution job in .github/workflows/docs-tests-cicd.yml so 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

Filename Overview
.github/workflows/docs-tests-cicd.yml Adds a job-level if condition to skip the execution job when NOTTE_API_KEY is absent, preventing false-red failures on fork PRs.

Reviews (1): Last reviewed commit: "ci: skip execution job when NOTTE_API_KE..." | Re-trigger Greptile

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.
@mendral-app mendral-app Bot marked this pull request as ready for review April 23, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants