Skip to content

fix(label-prs): fail workflow on GitHub API error instead of swallowing it#38

Open
Osraka wants to merge 1 commit into
tempoxyz:mainfrom
Osraka:fix/label-prs-fail-on-api-error
Open

fix(label-prs): fail workflow on GitHub API error instead of swallowing it#38
Osraka wants to merge 1 commit into
tempoxyz:mainfrom
Osraka:fix/label-prs-fail-on-api-error

Conversation

@Osraka

@Osraka Osraka commented Jul 16, 2026

Copy link
Copy Markdown

Closes #33

What changed

  • rethrow GitHub API errors after logging them in the label-prs script
  • preserve the existing no-op behavior when a PR has no linked issue
  • add focused regression coverage for issue lookup and label update failures

Why

The previous catch block logged failures and returned normally, so the actions/github-script step could report success even when GitHub could not read the referenced issue or apply labels. The workflow now fails visibly and can be retried or investigated.

Validation

  • node --test .github/scripts/label_pr.test.js
  • node --check .github/scripts/label_pr.js
  • git diff --check

The existing actions/pr-audit-comment/pr_audit_comment.test.js has one unrelated baseline failure on macOS Bash 3.2 because the workflow script uses [[ -v ... ]], which is supported by the GitHub runner shell.

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.

label-prs swallows GitHub API failures

1 participant