feat: Support business window constraint#771
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for restricting auto-merge behavior to a configurable “business hours” window, addressing #770 by introducing a 5-field cron-based merge window with optional IANA timezone evaluation. When outside the configured window, the action skips merging and exposes a distinct merge_status.
Changes:
- Introduces
merge-window/merge-window-timezoneinputs and documents them. - Adds a cron parser + time-window evaluator (
src/mergeWindow.js) with unit tests. - Integrates merge-window evaluation into the action flow and adds a new skip status (
skipped:outside_merge_window).
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/util.test.js | Adds coverage for new input parsing/whitespace trimming. |
| test/mergeWindow.test.js | Adds unit tests for cron parsing and window matching behavior. |
| test/action.test.js | Adds action-level behavior tests for skipping/merging based on merge-window. |
| src/util.js | Adds new inputs to getInputs() and new merge status constant. |
| src/mergeWindow.js | Implements cron parsing and “is now within merge window” logic. |
| src/action.js | Skips merge when outside the configured merge window; sets output status + log. |
| README.md | Documents new inputs, output status, and provides usage guidance. |
| dist/index.js | Bundled output updated to include merge-window feature. |
| action.yml | Declares new action inputs for merge-window and timezone. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
fixes #770
Checklist
npm run test && npm run benchmark --if-present