Skip to content

fix: skip Codecov upload when CODECOV_TOKEN is unavailable (Dependabot PRs) - #11

Merged
LanierDevelopments-LLC merged 1 commit into
mainfrom
fix/codecov-dependabot-secret
Aug 19, 2026
Merged

LanierDevelopments-LLC merged 1 commit into
mainfrom
fix/codecov-dependabot-secret

Conversation

@LanierDevelopments-LLC

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #10, same root cause, different secret: CODECOV_TOKEN is an Actions secret, which GitHub withholds from Dependabot-triggered pull_request runs. Combined with fail_ci_if_error: true, that turned a harmless missing-token situation into a hard job failure on every Dependabot CI-bump PR — confirmed by rebasing PR #8 onto the #10 fixes: pytest itself passed cleanly, then the Codecov upload step failed with Token required - not valid tokenless upload.

Fix: promote CODECOV_TOKEN to job-level env (same pattern as the Snyk fix) and skip the upload step when it's empty. Real uploads still run normally on regular PRs/pushes to main where the secret is available.

Test plan

  • actionlint .github/workflows/*.yml — clean
  • ruff check src tests / mypy src — clean
  • pytest tests --cov=src/prompt_optimizer — 148 passed, 2 skipped, 0 failed
  • CI green on this PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01D1NqmG98y1XiSRBYk4SXoU

…t PRs)

Same root cause as the Snyk fix in #10: CODECOV_TOKEN is an Actions
secret, which GitHub withholds from Dependabot-triggered pull_request
runs. Combined with fail_ci_if_error: true, that turned a harmless
missing-token situation into a hard job failure on every Dependabot
CI-bump PR (confirmed on PR #8 after rebasing onto the #10 fixes:
pytest itself passed, then the Codecov upload step failed with
"Token required - not valid tokenless upload").

Verified with actionlint (clean) and the full local suite (148 passed,
2 skipped, OPENAI_API_KEY/ANTHROPIC_API_KEY unset).
@LanierDevelopments-LLC
LanierDevelopments-LLC merged commit 53ca012 into main Aug 19, 2026
5 checks passed
@LanierDevelopments-LLC
LanierDevelopments-LLC deleted the fix/codecov-dependabot-secret branch August 19, 2026 21:41
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.

1 participant