From 3d5df0b2168ba49061a41ade5ad2eb9343c2f757 Mon Sep 17 00:00:00 2001 From: Lahiru Maramba Date: Wed, 21 Oct 2026 15:33:01 -0400 Subject: [PATCH 1/2] chore(ci): Enforce and guide PRs to target the dev branch Add a CI check to verify pull requests target the dev branch, and update PR template, CONTRIBUTING.md, and AGENTS.md to guide contributors to target dev. --- .github/pull_request_template.md | 3 +++ .github/workflows/ci.yml | 13 +++++++++++++ AGENTS.md | 4 +++- CONTRIBUTING.md | 4 ++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3d81fd0c9..80fc180e6 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,6 @@ +> [!IMPORTANT] +> **Target Branch:** Please make sure the **base branch** dropdown above is set to **`dev`** (not `master`). All development work takes place on the `dev` branch. + Hey there! So you want to contribute to a Firebase SDK? Before you file this pull request, please read these guidelines: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9b2c9b47..e84456dce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,19 @@ name: Continuous Integration on: pull_request jobs: + check_base_branch: + name: Check base branch + runs-on: ubuntu-latest + steps: + - name: Verify target branch is dev + env: + BASE_REF: ${{ github.base_ref }} + run: | + if [[ "${BASE_REF}" != "dev" ]]; then + echo "::error title=Invalid Base Branch::Pull requests must target the 'dev' branch (currently targeting '${BASE_REF}'). Please edit this PR to change the base branch to 'dev'." + exit 1 + fi + module: name: Module build runs-on: ubuntu-latest diff --git a/AGENTS.md b/AGENTS.md index b2d6d89a7..f5f08a13b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -69,7 +69,8 @@ The Firebase Admin Go SDK enables server-side (backend) applications to interact - **DON'T:** Introduce new third-party dependencies without a strong, documented justification and team consensus. ## 9. Branch Creation -- When creating a new barnch use the format `agentName-short-description`. +- Always create new branches from the `dev` branch (never `master`). +- When creating a new branch use the format `agentName-short-description`. * Example: `jules-auth-token-parsing` * Example: `gemini-add-storage-file-signer` @@ -77,6 +78,7 @@ The Firebase Admin Go SDK enables server-side (backend) applications to interact ## 10. Commit and Pull Request Generation After implementing and testing a change, you may create a commit and pull request which must follow the following these rules: +- Always target the `dev` branch as the base branch when creating a pull request (e.g., `gh pr create --base dev`). Never target `master`. ### Commit and Pull Request Title Format: Use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification: `type(scope): subject` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 901fad267..6f40965a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,7 +47,7 @@ Great, we love hearing how we can improve our products! Share you idea through o ## Want to submit a pull request? Sweet, we'd love to accept your contribution! -[Open a new pull request](https://github.com/firebase/firebase-admin-go/pull/new/master) and fill +[Open a new pull request](https://github.com/firebase/firebase-admin-go/compare/dev...) and fill out the provided template. Make sure to create all your pull requests against the `dev` branch. All development @@ -98,7 +98,7 @@ to checkout the sources of Firebase Admin SDK, and its dependencies: ```bash $ cd $GOPATH -$ git clone https://github.com/firebase/firebase-admin-go.git src/firebase.google.com/go +$ git clone -b dev https://github.com/firebase/firebase-admin-go.git src/firebase.google.com/go $ go get -d -t firebase.google.com/go/... # Install dependencies ``` From 41858b82c7663f60b6f3c1ef1704daf182f602e9 Mon Sep 17 00:00:00 2001 From: Lahiru Maramba Date: Wed, 21 Oct 2026 15:50:39 -0400 Subject: [PATCH 2/2] chore: Replace master branch references with main Update branch references from master to main in PR template, CONTRIBUTING.md, AGENTS.md, and release.yml. --- .github/pull_request_template.md | 2 +- .github/workflows/release.yml | 12 ++++++------ AGENTS.md | 4 ++-- CONTRIBUTING.md | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 80fc180e6..cce85948a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,5 +1,5 @@ > [!IMPORTANT] -> **Target Branch:** Please make sure the **base branch** dropdown above is set to **`dev`** (not `master`). All development work takes place on the `dev` branch. +> **Target Branch:** Please make sure the **base branch** dropdown above is set to **`dev`** (not `main`). All development work takes place on the `dev` branch. Hey there! So you want to contribute to a Firebase SDK? Before you file this pull request, please read these guidelines: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0adaa5a9a..45917cda4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,15 +102,15 @@ jobs: run: ./.github/scripts/publish_preflight_check.sh # We authorize this step with temporary GitHub App installation token that has - # write access to the master branch. - - name: Fast-forward master to dev + # write access to the main branch. + - name: Fast-forward main to dev run: | git checkout dev git pull origin dev - git checkout master - git pull origin master + git checkout main + git pull origin main git merge dev --ff-only - git push origin master + git push origin main # See: https://cli.github.com/manual/gh_release_create - name: Create release tag @@ -122,4 +122,4 @@ jobs: gh release create "$RELEASE_VER" \ --title "Firebase Admin Go SDK $RELEASE_VER" \ --notes "$RELEASE_BODY" \ - --target "master" + --target "main" diff --git a/AGENTS.md b/AGENTS.md index f5f08a13b..757a4c760 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -69,7 +69,7 @@ The Firebase Admin Go SDK enables server-side (backend) applications to interact - **DON'T:** Introduce new third-party dependencies without a strong, documented justification and team consensus. ## 9. Branch Creation -- Always create new branches from the `dev` branch (never `master`). +- Always create new branches from the `dev` branch (never `main`). - When creating a new branch use the format `agentName-short-description`. * Example: `jules-auth-token-parsing` * Example: `gemini-add-storage-file-signer` @@ -78,7 +78,7 @@ The Firebase Admin Go SDK enables server-side (backend) applications to interact ## 10. Commit and Pull Request Generation After implementing and testing a change, you may create a commit and pull request which must follow the following these rules: -- Always target the `dev` branch as the base branch when creating a pull request (e.g., `gh pr create --base dev`). Never target `master`. +- Always target the `dev` branch as the base branch when creating a pull request (e.g., `gh pr create --base dev`). Never target `main`. ### Commit and Pull Request Title Format: Use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification: `type(scope): subject` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f40965a5..0f94ee643 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,9 +51,9 @@ Sweet, we'd love to accept your contribution! out the provided template. Make sure to create all your pull requests against the `dev` branch. All development -work takes place on this branch, while the `master` branch is dedicated for released +work takes place on this branch, while the `main` branch is dedicated for released stable code. This enables us to review and merge routine code changes, without -impacting downstream applications that are building against our `master` +impacting downstream applications that are building against our `main` branch. **If you want to implement a new feature, please open an issue with a proposal first so that we can