diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3d81fd0c..cce85948 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 `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/ci.yml b/.github/workflows/ci.yml index f9b2c9b4..e84456dc 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/.github/workflows/release.yml b/.github/workflows/release.yml index 0adaa5a9..45917cda 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 b2d6d89a..757a4c76 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 `main`). +- 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 `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 901fad26..0f94ee64 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,13 +47,13 @@ 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 -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 @@ -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 ```