diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 0ddb512d..3e98ae70 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,9 +1,9 @@ -# https://github.com/googleapis/repo-automation-bots/tree/master/packages/sync-repo-settings -# Rules for master branch protection +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings +# Rules for main branch protection branchProtectionRules: # Identifies the protection rule pattern. Name of the branch to be protected. -# Defaults to `master` -- pattern: master +# Defaults to `main` +- pattern: main requiresCodeOwnerReviews: true requiresStrictStatusChecks: true requiredStatusCheckContexts: diff --git a/owlbot.py b/owlbot.py index 9857c5b2..6e278dd7 100644 --- a/owlbot.py +++ b/owlbot.py @@ -106,6 +106,65 @@ '\n', ) + # Remove the replacements below once + # https://github.com/googleapis/synthtool/pull/1188 is merged + + # Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files + s.replace( + ".kokoro/*.sh", + "repo-automation-bots/tree/master", + "repo-automation-bots/tree/main", + ) + + # Customize CONTRIBUTING.rst to replace master with main + s.replace( + "CONTRIBUTING.rst", + "fetch and merge changes from upstream into master", + "fetch and merge changes from upstream into main", + ) + + s.replace( + "CONTRIBUTING.rst", + "git merge upstream/master", + "git merge upstream/main", + ) + + s.replace( + "CONTRIBUTING.rst", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""", + ) + + s.replace( + "CONTRIBUTING.rst", + "remote \(``master``\)", + "remote (``main``)", + ) + + s.replace( + "CONTRIBUTING.rst", + "blob/master/CONTRIBUTING.rst", + "blob/main/CONTRIBUTING.rst", + ) + + s.replace( + "CONTRIBUTING.rst", + "blob/master/noxfile.py", + "blob/main/noxfile.py", + ) + + s.replace( + "docs/conf.py", + "master_doc", + "root_doc", + ) + + s.replace( + "docs/conf.py", + "# The master toctree document.", + "# The root toctree document.", + ) + s.move( library, excludes=[