Skip to content

Fail DNS apply early with a clear error when Porkbun secrets are empty - #1

Closed
martinbonnin with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-failing-github-actions-apply-job
Closed

martinbonnin with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-failing-github-actions-apply-job

Conversation

Copilot AI commented Oct 8, 2026 •

Copy link
Copy Markdown

The apply job failed with 400 API Key Required / APIError: All API requests require an API key or API token. PORKBUN_API_KEY and/or PORKBUN_SECRET_KEY reached the step as empty values, so octoDNS called Porkbun with no credentials. The workflow and config/octodns.yaml wiring is correct. The underlying cause is a missing or empty secret, which this PR cannot fix.

  • .github/workflows/dns-apply.yml
    • The octoDNS apply step now checks that both env vars are non-empty before running octodns-sync.
    • If either is empty, it emits a ::error:: annotation naming the secrets and exits 1. This replaces the Porkbun traceback with a message pointing at the actual problem.
if [ -z "$PORKBUN_API_KEY" ] || [ -z "$PORKBUN_SECRET_KEY" ]; then
  echo "::error::PORKBUN_API_KEY and/or PORKBUN_SECRET_KEY are empty. ..."
  exit 1
fi
octodns-sync --config-file=config/octodns.yaml --doit

Needed before the job can pass: set PORKBUN_API_KEY and PORKBUN_SECRET_KEY as repo secrets, or as secrets on the production environment that this job runs in. Also confirm API Access is enabled for api-standards.io in Porkbun. Without that, the job will still fail, now with the clearer error.

dns-plan.yml has the same unguarded step and was left unchanged.

Co-authored-by: martinbonnin <3974977+martinbonnin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job apply Fail DNS apply early with a clear error when Porkbun secrets are empty Oct 8, 2026
Copilot AI requested a review from martinbonnin October 8, 2026 09:04
Copilot stopped work on behalf of martinbonnin due to an error October 8, 2026 09:04
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.

2 participants