Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEG-3530: The default branch does not follow branch naming conventions #176

Merged
merged 3 commits into from
Jan 31, 2023

Conversation

blade47
Copy link
Contributor

@blade47 blade47 commented Jan 31, 2023

The default branch of our repositories should be named 'main'.

In order to pass this check, ensure that your default branch is named 'main'.

Linear story: PEG-3530

Have you done ...

  • Unit tests

@blade47 blade47 requested a review from a team as a code owner January 31, 2023 10:06
@linear
Copy link

linear bot commented Jan 31, 2023

PEG-3530 Migrate JVM-Commons and Prop default branch from Master to Main

The default branch does not follow branch naming conventions

The default branch of our repositories should be named 'main'.

In order to pass this check, ensure that your default branch is named 'main'.

What steps to take to rename master to main?

  • Ensure all your workflows pointing to master also get triggered on main, by manually changing the workflows.
    You can check all the .defaultBranch entries in centralized-templates for the workflows you have distributed, e.g.
on:
  push:
    branches:
    - master
    - main

or

${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' }}
  • Rename master to main in repository settings
  • Ensure engineers update their local environment to use renamed main branch (instead master)
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
  • Update the default branch to main (or remove the defaultBranch property, as it's main by default) in file-distributor, which will override the manual changes you did in step 1. to only trigger on main. 

Other suggestions (same purpose):

  • rename the default branch through the repository settings on your GitHub repository
  • create a PR where all instances of master in your workflows is renamed to main
  • merge that PR
  • (optionally) bump your .github/templates.yaml version to verify that you’re up to date on workflows and that the default branch is detected correctly

@blade47 blade47 merged commit eb73c31 into main Jan 31, 2023
@blade47 blade47 deleted the feature/peg-3530-migrate-jvm-commons-and-prop-default branch January 31, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants