Fix: Improve PR number validation and warning messages in input handling#939
Merged
HarithaVattikuti merged 3 commits intoJun 22, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes validation for the pr-number input so invalid values (non-numeric, zero, negative) are rejected before reaching the GitHub API, and it improves the warning message to echo what the user actually typed.
Changes:
- Fixes the validation condition in
get-pr-numbers.tsfrom&&to||soNaN,0, and negative values are all rejected. - Updates the warning message to reference the raw input line rather than the parsed result.
- Adds test coverage for invalid and mixed-validity
pr-numberinputs and updates the builtdist/index.jsaccordingly.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/get-inputs/get-pr-numbers.ts | Corrects PR number validation logic and improves warning clarity. |
| dist/index.js | Updates the compiled distribution output to match the source fix. |
| tests/main.test.ts | Adds tests ensuring invalid pr-number inputs warn and avoid API calls, and mixed inputs still process valid PRs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mahabaleshwars
previously approved these changes
Jun 4, 2026
priya-kinthali
previously approved these changes
Jun 4, 2026
5 tasks
9a05e78
mahabaleshwars
approved these changes
Jun 18, 2026
priya-kinthali
approved these changes
Jun 18, 2026
chaoscommencer
approved these changes
Jun 19, 2026
chaoscommencer
left a comment
There was a problem hiding this comment.
I'm not familiar with the configuration requirements for the unit tests, but the character validation looks good!
HarithaVattikuti
approved these changes
Jun 22, 2026
eleboucher
pushed a commit
to eleboucher/homelab
that referenced
this pull request
Jul 9, 2026
…v6.1.0 ➔ v6.2.0) (#1478) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://github.com/actions/labeler](https://github.com/actions/labeler) | action | minor | `v6.1.0` → `v6.2.0` | --- ### Release Notes <details> <summary>actions/labeler (https://github.com/actions/labeler)</summary> ### [`v6.2.0`](https://github.com/actions/labeler/releases/tag/v6.2.0) [Compare Source](actions/labeler@v6.1.0...v6.2.0) #### What's Changed ##### Bug Fix - Improve PR number validation and warning messages in input handling by [@​chiranjib-swain](https://github.com/chiranjib-swain) in [#​939](actions/labeler#939) ##### Dependency Updates - Bump js-yaml to 4.2.0, apply npm audit fix, and add undici override by [@​dependabot](https://github.com/dependabot) in [#​943](actions/labeler#943) - Bump [@​typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin) from 8.59.1 to 8.61.1 by [@​dependabot](https://github.com/dependabot) in [#​942](actions/labeler#942) **Full Changelog**: <actions/labeler@v6.1.0...v6.2.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9naXRodWItYWN0aW9uIiwidHlwZS9taW5vciJdfQ==--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/1478
hbjydev
pushed a commit
to hbjydev/phoebe
that referenced
this pull request
Jul 9, 2026
…v6.1.0 → v6.2.0) (#234) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://github.com/actions/labeler](https://github.com/actions/labeler) | action | minor | `v6.1.0` → `v6.2.0` | --- ### Release Notes <details> <summary>actions/labeler (https://github.com/actions/labeler)</summary> ### [`v6.2.0`](https://github.com/actions/labeler/releases/tag/v6.2.0) [Compare Source](actions/labeler@v6.1.0...v6.2.0) #### What's Changed ##### Bug Fix - Improve PR number validation and warning messages in input handling by [@​chiranjib-swain](https://github.com/chiranjib-swain) in [#​939](actions/labeler#939) ##### Dependency Updates - Bump js-yaml to 4.2.0, apply npm audit fix, and add undici override by [@​dependabot](https://github.com/dependabot) in [#​943](actions/labeler#943) - Bump [@​typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin) from 8.59.1 to 8.61.1 by [@​dependabot](https://github.com/dependabot) in [#​942](actions/labeler#942) **Full Changelog**: <actions/labeler@v6.1.0...v6.2.0> </details> --- ### Configuration 📅 **Schedule**: (in timezone Europe/London) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDIuMSIsInVwZGF0ZWRJblZlciI6IjQzLjI0Mi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9naXRodWItYWN0aW9uIiwidHlwZS9taW5vciJdfQ==--> Reviewed-on: https://forgejo.hayden.moe/hayden/phoebe/pulls/234
doonga
pushed a commit
to greyrock-labs/home-ops
that referenced
this pull request
Jul 9, 2026
…v6.1.0 ➔ v6.2.0) (#490) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://github.com/actions/labeler](https://github.com/actions/labeler) | action | minor | `v6.1.0` → `v6.2.0` | --- ### Release Notes <details> <summary>actions/labeler (https://github.com/actions/labeler)</summary> ### [`v6.2.0`](https://github.com/actions/labeler/releases/tag/v6.2.0) [Compare Source](actions/labeler@v6.1.0...v6.2.0) #### What's Changed ##### Bug Fix - Improve PR number validation and warning messages in input handling by [@​chiranjib-swain](https://github.com/chiranjib-swain) in [#​939](actions/labeler#939) ##### Dependency Updates - Bump js-yaml to 4.2.0, apply npm audit fix, and add undici override by [@​dependabot](https://github.com/dependabot) in [#​943](actions/labeler#943) - Bump [@​typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin) from 8.59.1 to 8.61.1 by [@​dependabot](https://github.com/dependabot) in [#​942](actions/labeler#942) **Full Changelog**: <actions/labeler@v6.1.0...v6.2.0> </details> --- ### Configuration 📅 **Schedule**: (in timezone America/New_York) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNTIuMSIsInVwZGF0ZWRJblZlciI6IjQzLjI1Mi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9naXRodWItYWN0aW9uIiwicmVub3ZhdGUvZ2l0aHViLXJlbGVhc2UiLCJ0eXBlL21pbm9yIl19--> Reviewed-on: https://git.greyrock.io/greyrock-labs/home-ops/pulls/490
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.
Description:
This pull request enhances the validation and handling of the
pr-numberinput for pull requests, ensuring that only valid, positive integers are processed and that invalid or malformed inputs are clearly reported with sanitized warnings. It also adds comprehensive test coverage for these scenarios.Test coverage improvements:
main.test.tsto verify that the action warns and skips API calls for various invalidpr-numberinputs, including non-numeric strings, negative numbers, zero, numbers with spaces or non-numeric characters, and strings with non-printable or ANSI escape characters. The tests also confirm that valid numbers with whitespace are handled correctly and that a mix of valid and invalid inputs processes only the valid ones.Input validation and sanitization enhancements:
sanitizeForWarningfunction inget-pr-numbers.tsto escape non-printable characters in warning messages, making them more readable and secure.getPrNumbersfunction to:Related issue:
#937
Check list: