feat: add --bump-patch-version and --no-prompt flags to merge-pull-requests-by-title.sh#158
feat: add --bump-patch-version and --no-prompt flags to merge-pull-requests-by-title.sh#158
Conversation
…-title.sh Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
|
@copilot I also think that the merge should have a --merge or --confirm flag so it doesn't jsut auto merge without confirmation on this guy... lilke maybe default is interactively and there is a --confirm or --no-confirm or maybe --no-prompt that does it without prompting |
Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
Added in 8a1fd57. Merge mode now prompts |
There was a problem hiding this comment.
Pull request overview
Updates the merge-pull-requests-by-title.sh gh-cli helper to add safer merge behavior (optional per-PR confirmation) and a new mode to bump npm patch versions on matching PR branches before merging, along with corresponding README documentation updates.
Changes:
- Add
--no-promptto allow non-interactive batch merging without per-PR confirmation - Add
--bump-patch-versionmode to clone matching PR branches, run an npm patch bump, commit, and push - Update
gh-cli/README.mdusage examples and script description to reflect the new flags/mode
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| gh-cli/README.md | Documents new --no-prompt behavior and adds --bump-patch-version example usage |
| gh-cli/merge-pull-requests-by-title.sh | Implements confirmation prompting, branch extraction, and npm patch bump workflow |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds new operational modes and safety controls to the merge-pull-requests-by-title.sh script to better handle Dependabot PR workflows that require an npm patch version bump and to avoid unintended bulk merges.
Changes:
- Added
--bump-patch-versionmode to clone PR branches, bump npm patch version, commit, and push (optionally enabling auto-merge). - Added interactive per-PR merge confirmation by default, plus
--no-promptto merge without confirmation. - Updated matching PR query output to include branch names and refreshed README usage examples.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| gh-cli/merge-pull-requests-by-title.sh | Adds bump-and-push workflow, auto-merge support, interactive prompting, and updated PR querying/filters. |
| gh-cli/README.md | Documents new flags and provides updated usage examples. |
You can also share your feedback on Copilot code review. Take the survey.
…--enable-auto-merge options
There was a problem hiding this comment.
Pull request overview
Updates the gh-cli/merge-pull-requests-by-title.sh utility to support optionally bumping npm patch versions on matching PR branches (to satisfy CI requirements) and to make batch merging safer via per-PR confirmation (with an opt-out flag).
Changes:
- Add
--bump-patch-versionmode to clone matching PR branches, runnpm version patch, commit, and push (optionally enabling auto-merge) - Add interactive confirmation before each merge by default, plus
--no-promptto merge without confirmation - Update
gh-cli/README.mdusage examples to document the new flags
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| gh-cli/merge-pull-requests-by-title.sh | Implements new bump mode, auto-merge support, and default interactive confirmation for merges |
| gh-cli/README.md | Documents updated behavior and adds examples for --bump-patch-version and --no-prompt |
You can also share your feedback on Copilot code review. Take the survey.
| if ! [[ -t 0 ]]; then | ||
| echo "Error: No TTY available for interactive prompt - use --no-prompt" |
| repo_list_file=${positional_args[0]} | ||
| pr_title_pattern=${positional_args[1]} | ||
| merge_method=${positional_args[2]:-squash} | ||
| commit_title=${positional_args[3]:-} |
| @@ -31,44 +40,88 @@ | |||
| # - PRs must be open and in a mergeable state | |||
| # - Use * as a wildcard in the title pattern (e.g., "chore(deps)*" matches any title starting with "chore(deps)") | |||
| # - If multiple PRs match in a repo, all will be listed but only the first will be merged (use --dry-run to preview) | |||
| @@ -128,16 +181,33 @@ while IFS= read -r repo_url || [ -n "$repo_url" ]; do | |||
| jq_pattern="${jq_pattern//$/\\$}" | |||
| jq_pattern="${jq_pattern//|/\\|}" | |||
When a Dependabot PR updates a prod dependency, CI often requires a patch version bump before the PR can merge. Previously this meant manually cloning, switching branches, running
npm version patch, committing, and pushing for each affected repo. Additionally, the merge command previously auto-merged all matching PRs without any confirmation.Changes
--bump-patch-versionflag – mutually exclusive with--dry-run; finds matching PRs, clones each branch, bumps the npm patch version, and pushesgh repo clone– handles private repos without extra credential setuppackage-lock.jsonstaged if present – gracefully skips if absentchore: bump version to <version>❓ Merge owner/repo#N? [y/N]before each PR; declining increments the "Skipped" counter--no-promptflag – skips the per-PR confirmation and merges all matching PRs automaticallyUsage
Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.