Skip Neon preview branch jobs when PR secrets are unavailable#51
Conversation
Agent-Logs-Url: https://github.com/quantumdynamics927-dotcom/QPyth/sessions/215a653e-2dbf-4ef6-a217-39cd115d2f5f Co-authored-by: quantumdynamics927-dotcom <247722560+quantumdynamics927-dotcom@users.noreply.github.com>
Agent-Logs-Url: https://github.com/quantumdynamics927-dotcom/QPyth/sessions/215a653e-2dbf-4ef6-a217-39cd115d2f5f Co-authored-by: quantumdynamics927-dotcom <247722560+quantumdynamics927-dotcom@users.noreply.github.com>
Agent-Logs-Url: https://github.com/quantumdynamics927-dotcom/QPyth/sessions/215a653e-2dbf-4ef6-a217-39cd115d2f5f Co-authored-by: quantumdynamics927-dotcom <247722560+quantumdynamics927-dotcom@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR makes the Neon preview branch workflow resilient to GitHub’s secret restrictions (notably Dependabot pull_request runs) by adding an explicit guard that skips Neon create/delete jobs when credentials aren’t available, and documents the intended skip behavior.
Changes:
- Add a setup-time
neon_enabledgate that detects missingNEON_API_KEY/NEON_PROJECT_IDand Dependabot actors. - Update
create_neon_branchanddelete_neon_branchjob conditions to run only whenneon_enabledis true. - Document the new “skipped by design” behavior in workflow setup/troubleshooting docs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/neon-preview-branches.yml |
Adds neon_enabled output guard and uses it to conditionally run Neon create/delete jobs. |
docs/neon-preview-workflow.md |
Documents that Neon jobs are skipped (not failed) for Dependabot or missing credentials. |
GITHUB_ACTIONS_SETUP.md |
Adds troubleshooting guidance explaining Dependabot secret limitations and expected skips. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if [ -z "$NEON_API_KEY" ] || [ -z "$NEON_PROJECT_ID" ]; then | ||
| enabled=false | ||
| echo "Skipping Neon preview jobs because repository Neon credentials are unavailable." | ||
| elif [ "$WORKFLOW_ACTOR" = "dependabot[bot]" ]; then | ||
| enabled=false | ||
| echo "Skipping Neon preview jobs for Dependabot pull requests because secrets are not exposed." |
There was a problem hiding this comment.
The Dependabot-specific skip message is currently unreachable when secrets are not exposed: for Dependabot PRs, NEON_API_KEY will be empty, so the first if branch fires and logs "credentials are unavailable" instead of the Dependabot explanation. Consider checking WORKFLOW_ACTOR == dependabot[bot] first (or using separate if blocks) so the logs accurately describe why the jobs are skipped.
| if [ -z "$NEON_API_KEY" ] || [ -z "$NEON_PROJECT_ID" ]; then | |
| enabled=false | |
| echo "Skipping Neon preview jobs because repository Neon credentials are unavailable." | |
| elif [ "$WORKFLOW_ACTOR" = "dependabot[bot]" ]; then | |
| enabled=false | |
| echo "Skipping Neon preview jobs for Dependabot pull requests because secrets are not exposed." | |
| if [ "$WORKFLOW_ACTOR" = "dependabot[bot]" ]; then | |
| enabled=false | |
| echo "Skipping Neon preview jobs for Dependabot pull requests because secrets are not exposed." | |
| elif [ -z "$NEON_API_KEY" ] || [ -z "$NEON_PROJECT_ID" ]; then | |
| enabled=false | |
| echo "Skipping Neon preview jobs because repository Neon credentials are unavailable." |
|
|
||
| **What to do**: | ||
| 1. No action is required for Dependabot PRs; skipping is expected | ||
| 2. For regular PRs, add `NEON_API_KEY` and `NEON_PROJECT_ID` in repository Actions settings if Neon preview branches should run |
There was a problem hiding this comment.
This troubleshooting step says to add both NEON_API_KEY and NEON_PROJECT_ID in "repository Actions settings", but earlier in the doc NEON_API_KEY is a Secret while NEON_PROJECT_ID is a Repository Variable. Suggest explicitly calling out "Secrets and variables" (and which one goes where) to avoid misconfiguration.
| 2. For regular PRs, add `NEON_API_KEY` and `NEON_PROJECT_ID` in repository Actions settings if Neon preview branches should run | |
| 2. For regular PRs, add `NEON_API_KEY` as a repository Actions **Secret** and `NEON_PROJECT_ID` as a repository Actions **Variable** if Neon preview branches should run |
Dependabot
pull_requestruns were failing inCreate Neon BranchbecauseNEON_API_KEYis not exposed to those workflows. As a result, the Neon preview workflow turned expected secret restrictions into hard CI failures.Workflow guard
.github/workflows/neon-preview-branches.ymlthat computes whether Neon preview jobs should run.NEON_API_KEYorNEON_PROJECT_IDis missingdependabot[bot]Job conditions
create_neon_branchanddelete_neon_branchto depend on the computedneon_enabledoutput instead of assuming secrets are always available.Docs
Example of the new guard: