Use wrapApiConfigurationError more for init-action-post - #4178
Conversation
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Copilot review overview
🟡 Changes recommended
The newly added API rejection behavior lacks direct unit coverage.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Improves configuration-error classification during init-action-post.
Changes:
- Reuses the saved GitHub version when available.
- Wraps known API failures as configuration errors.
- Documents and types the error wrapper.
| File | Description |
|---|---|
src/init-action-post.ts |
Reuses configuration and classifies API errors. |
src/api-client.ts |
Wraps GitHub version API failures. |
lib/entry-points.js |
Generated, excluded file; not reviewed. |
Files excluded by content exclusion policy (1)
- lib/entry-points.js
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@mario-campos I pushed three more commits here. The first two just refactor the existing tests for |
mario-campos
left a comment
There was a problem hiding this comment.
Makes sense 👍
One minor suggestion: I don't see a test for the wrapApiConfigurationError fallback/identity path (i.e. the one in which you pass a non-error value and it is returned). If it already exists and I just missed it, feel free to ignore.
@mario-campos Several of the tests for |

This PR adds
wrapApiConfigurationErrorhandling to the general exception handler for theinit-action-poststep. Also includes some related, minor improvements.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, Code Quality, ...).Products:
analysis-kinds: code-scanning.analysis-kinds: code-quality.upload-sarifaction.Environments:
github.comand/or GitHub Enterprise Cloud with Data Residency.How did/will you validate this change?
.test.tsfiles).pr-checks).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist