Skip to content

Ci/automerge develop to main#85

Open
brendanobra wants to merge 4 commits into
developfrom
ci/automerge-develop-to-main
Open

Ci/automerge develop to main#85
brendanobra wants to merge 4 commits into
developfrom
ci/automerge-develop-to-main

Conversation

@brendanobra

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 29, 2026 23:53

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 merges source_branchtarget_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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants