Move validateExclusiveModes before getBody for fail-fast validation#1663
Merged
Conversation
…e+hide_and_recreate check Co-authored-by: marocchino <[email protected]>
Copilot
AI
changed the title
[WIP] Fix validation for delete and hide options
Refactor mutually exclusive option validation to list-based approach
Mar 13, 2026
Co-authored-by: marocchino <[email protected]>
Copilot
AI
changed the title
Refactor mutually exclusive option validation to list-based approach
Refactor mutually exclusive option validation to unified list-based approach
Mar 13, 2026
Co-authored-by: marocchino <[email protected]>
Copilot
AI
changed the title
Refactor mutually exclusive option validation to unified list-based approach
Separate validation logic into dedicated module
Mar 13, 2026
Co-authored-by: marocchino <[email protected]>
Copilot
AI
changed the title
Separate validation logic into dedicated module
Extract validation logic into Mar 13, 2026
src/validate.ts; run exclusive-mode check before getBody
Co-authored-by: marocchino <[email protected]>
Copilot
AI
changed the title
Extract validation logic into
Move validateExclusiveModes before getBody for fail-fast validation
Mar 13, 2026
src/validate.ts; run exclusive-mode check before getBody
Output of npm run all> [email protected] all
> npm run build && npm run format && npm run lint && npm run package && npm run test
> [email protected] build
> tsc
> [email protected] format
> biome format --write .
Formatted 5 files in 4ms. No fixes applied.
> [email protected] lint
> biome check .
Checked 5 files in 8ms. No fixes applied.
> [email protected] package
> npx rimraf ./dist && npx rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript
�[36m
�[1msrc/main.ts�[22m → �[1mdist/index.js�[22m...�[39m
�[1m�[33m(!) "this" has been rewritten to "undefined"�[39m�[22m
�[90mhttps://rollupjs.org/troubleshooting/#error-this-is-undefined�[39m
�[1mnode_modules/@actions/core/lib/core.js�[22m
�[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
^
2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3: return new (P || (P = Promise))(function (resolve, reject) {�[39m
...and 1 other occurrence
�[1mnode_modules/@actions/glob/lib/glob.js�[22m
�[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
^
2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3: return new (P || (P = Promise))(function (resolve, reject) {�[39m
...and 1 other occurrence
�[1mnode_modules/@actions/core/lib/oidc-utils.js�[22m
�[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
^
2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3: return new (P || (P = Promise))(function (resolve, reject) {�[39m
...and 1 other occurrence
...and 11 other files
�[1m�[33m(!) Circular dependency�[39m�[22m
node_modules/@actions/core/lib/core.js -> node_modules/@actions/core/lib/oidc-utils.js -> node_modules/@actions/core/lib/core.js
�[32mcreated �[1mdist/index.js�[22m in �[1m3.5s�[22m�[39m
> [email protected] test
> vitest run
�[1m�[46m RUN �[49m�[22m �[36mv4.1.0 �[39m�[90m/home/runner/work/sticky-pull-request-comment/sticky-pull-request-comment�[39m
�[32m✓�[39m __tests__/config.test.ts �[2m(�[22m�[2m15 tests�[22m�[2m)�[22m�[32m 21�[2mms�[22m�[39m
�[32m✓�[39m __tests__/main.test.ts �[2m(�[22m�[2m22 tests�[22m�[2m)�[22m�[32m 139�[2mms�[22m�[39m
�[32m✓�[39m __tests__/comment.test.ts �[2m(�[22m�[2m19 tests�[22m�[2m)�[22m�[32m 20�[2mms�[22m�[39m
�[32m✓�[39m __tests__/validate.test.ts �[2m(�[22m�[2m14 tests�[22m�[2m)�[22m�[32m 9�[2mms�[22m�[39m
�[2m Test Files �[22m �[1m�[32m4 passed�[39m�[22m�[90m (4)�[39m
�[2m Tests �[22m �[1m�[32m70 passed�[39m�[22m�[90m (70)�[39m
�[2m Start at �[22m 12:05:24
�[2m Duration �[22m 542ms�[2m (transform 274ms, setup 0ms, import 524ms, tests 188ms, environment 0ms)�[22m
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Conflicting mode flags (e.g.
delete+recreate) were previously detected only aftergetBody()completed its file I/O. Reorder so validation fails immediately, before any I/O.Changes
src/main.ts: movevalidateExclusiveModes(...)aboveconst body = await getBody()__tests__/main.test.ts: addexpect(mockConfig.getBody).not.toHaveBeenCalled()to all six exclusive-mode failure tests — without this, a regression in call order would go undetectedOriginal prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.