-
Notifications
You must be signed in to change notification settings - Fork 2
Validate that at least one check is enabled (check-commits or check-pull-request) #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@copilot can you rebase and re-make these changes? I changed my action pretty significantly since originally requesting this (now native node action and not composite action with shell). |
I've rebased and re-implemented the validation for the new native Node.js action structure. The changes are now in commit
Note: The branch needs to be force-pushed to update the PR since it was rebased from the old composite action structure onto main. I've prepared the commit locally but don't have push permissions. You may need to pull the changes or I can create a new PR if needed. |
9c0f050 to
c6ec8d1
Compare
|
@copilot I had to manually |
Add validation to ensure at least one of 'check-commits' or 'check-pull-request' is enabled. If both are set to false, the action will fail with a clear error message. Changes: - Add validation check in src/index.js (lines 42-48) - Add 4 comprehensive test cases in __tests__/index.test.js - All 55 JavaScript tests + 29 bash tests passing Co-authored-by: joshjohanning <[email protected]>
I've re-implemented the validation check in commit Changes:
|
Validate that at least one check is enabled
Problem
The action could be misconfigured with both
check-commitsandcheck-pull-requestset tofalse, which would result in the action not performing any validation. This creates a confusing user experience where the action runs successfully but doesn't actually check anything.Solution
Added early validation to fail the action if both checks are disabled. The validation:
Changes
src/index.js
check-commitsandcheck-pull-requestarefalsetests/index.test.js
check-commitsenabled → passes ✅check-pull-requestenabled → passes ✅Testing
All tests passing:
npm run package)Fixes the issue where users could misconfigure the action with both checks disabled.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.