Skip to content

Create GHA job to sync master with main - #15

Merged
jasonkarns merged 1 commit into
masterfrom
sync-main-master
Jun 18, 2025
Merged

jasonkarns merged 1 commit into
masterfrom
sync-main-master

Conversation

@jasonkarns

Copy link
Copy Markdown
Member

Supports a transition period where the default branch is renamed to main, but all changes are reflected on master as well such that folks who have installed bats-support by using master will continue to receive updates for some time.

approach

This repo is still using the old master branch name as the default branch. I propose we rename to main.

The impact to contributors is minimal as we can all handle the rename tasks ourselves. However, because git is not just the tool for development, but also for distribution, this change potentially impacts users, not just contributors.

A process I have used successfully on other repos (virtually all nodenv repos) to facilitate the master -> main rename:

  1. create a "sync" job that force updates the master branch whenever main is modified
  • note that the job will be inert until the main branch exists
  1. rename master to main on github
  2. manual steps for contributors to change their local dev environment

At this point main is the official default branch and all work uses main. However, the master branch is preserved (as any normal branch). Any time main is modified, the job is triggered and force pushes to master to keep it in sync with main. Thus any users who have their bats testing environment set up by cloning from master will continue to get the latest code. But since main is then the new default branch, any clones that do not explicitly reference master, will get main as their default branch. So over time, references to master will gradually diminish. Eventually the sync job (and master branch) can just be deleted with drastically fewer (if any) users impacted.

Supports a transition period where the default branch is renamed to `main`, but all changes are reflected on master as well such that folks who have installed bats-support by using master will continue to receive updates for some time.
@jasonkarns
jasonkarns merged commit 0ad082d into master Jun 18, 2025
@jasonkarns
jasonkarns deleted the sync-main-master branch June 18, 2025 14:33
@jasonkarns

Copy link
Copy Markdown
Member Author
  1. merged
  2. renamed master to main via github
  3. which triggered the job and immediately "recreated" master at the same commit

https://github.com/bats-core/bats-support/branches

image

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.

2 participants