Ci/automerge develop to main#85
Open
brendanobra wants to merge 4 commits into
Open
Conversation
Patch Release 0.6.1
Release 0.6.2
…nto ci/automerge-develop-to-main
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds GitHub automation to keep main synchronized with develop by introducing a composite “sync-branches” action and a consumer workflow that runs on pushes to develop (with a manual workflow_dispatch option).
Changes:
- Added a composite action (
.github/actions/sync-branches) that mergessource_branch→target_branch, and falls back to opening/updating a PR on conflicts or push failures. - Added a consumer workflow (
sync-develop-to-main.yml) and a matching consumer template to run the sync automatically (with concurrency + permissions). - Added installer lock metadata and a release helper script for moving the floating major tag.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/sync-develop-to-main.yml | Consumer workflow to run develop→main sync on push/dispatch. |
| .github/automation-install.lock.json | Records installed automation module and managed files. |
| .github/actions/sync-branches/scripts/move-major-tag.sh | Release helper to move actions-v<major> tag to a stable release tag. |
| .github/actions/sync-branches/README.md | Usage/integration documentation for the sync action and installer flow. |
| .github/actions/sync-branches/consumer-template.yml | Template workflow consumers can copy to enable syncing. |
| .github/actions/sync-branches/action.yml | Composite action implementing merge/push with PR fallback behavior. |
|
|
||
| ### 1. Copy The Consumer Template | ||
|
|
||
| Copy `actions/sync-branches/consumer-template.yml` into your consumer repo as `.github/workflows/sync-develop-to-main.yml`. |
| | `git_user_email` | `github-actions[bot]@users.noreply.github.com` | Committer email | | ||
| | `pr_branch_prefix` | `auto-sync` | Prefix for fallback PR branches | | ||
| | `assign_reviewers` | `` | Comma-separated team/user handles for PR assignment | | ||
| | `pr_labels` | `auto-sync,needs-review` | Comma-separated labels for fallback PR | |
Comment on lines
+270
to
+272
| This integration guide is stored in `actions/sync-branches/` for easy discovery. | ||
|
|
||
| The composite action is at `actions/sync-branches/action.yml`. |
Comment on lines
+12
to
+15
| --version) | ||
| VERSION="$2" | ||
| shift 2 | ||
| ;; |
Comment on lines
+146
to
+150
| EXISTING=$(gh pr list \ | ||
| --base "${{ inputs.target_branch }}" \ | ||
| --state open \ | ||
| --json number,headRefName 2>/dev/null | \ | ||
| jq -r --arg prefix "$PR_BRANCH" 'map(select(.headRefName | startswith($prefix))) | .[0].number // empty' || echo "") |
Comment on lines
+202
to
+205
| UPDATE_BRANCH=$(gh pr view "$EXISTING" --json headRefName --jq .headRefName 2>/dev/null || echo "$PR_BRANCH") | ||
| git checkout -B "$UPDATE_BRANCH" "origin/${{ inputs.source_branch }}" | ||
| git push --force-with-lease origin "$UPDATE_BRANCH" | ||
| echo "PR #${EXISTING} branch updated to latest ${{ inputs.source_branch }} commits on $UPDATE_BRANCH." |
Comment on lines
+47
to
+50
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
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.
No description provided.