Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/publish_preflight_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ echo_info "Generating changelog"
echo_info "--------------------------------------------"
echo_info ""

echo_info "---< git fetch origin master --prune --unshallow >---"
git fetch origin master --prune --unshallow
echo_info "---< git fetch origin main --prune --unshallow >---"
git fetch origin main --prune --unshallow
Comment on lines +149 to +150

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better maintainability, it's a good practice to use a variable for the branch name instead of hardcoding it. This makes it easier to update in one place if the default branch name changes again in the future. You can use shell parameter expansion to provide a default value, which makes the script more robust.

Suggested change
echo_info "---< git fetch origin main --prune --unshallow >---"
git fetch origin main --prune --unshallow
echo_info "---< git fetch origin ${DEFAULT_BRANCH:-main} --prune --unshallow >---"
git fetch origin ${DEFAULT_BRANCH:-main} --prune --unshallow

echo ""

echo_info "Generating changelog from history..."
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ jobs:

# Check whether the release should be published. We publish only when the trigger PR is
# 1. merged
# 2. to the master branch
# 2. to the main branch
# 3. with the label 'release:publish', and
# 4. the title prefix '[chore] Release '.
if: github.event.pull_request.merged &&
github.ref == 'refs/heads/master' &&
if: |
github.event.pull_request.merged &&
github.ref == 'refs/heads/main' &&
contains(github.event.pull_request.labels.*.name, 'release:publish') &&
startsWith(github.event.pull_request.title, '[chore] Release ')

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Great, we love hearing how we can improve our products! Share you idea through o
## <a name="submit"></a>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-node/pull/new/master) and fill
[Open a new pull request](https://github.com/firebase/firebase-admin-node/pull/new/main) and fill

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make this link more robust and avoid hardcoding the default branch name, you can use a URL that automatically targets the default branch for new pull requests. This prevents the need for future updates if the default branch name changes again.

Suggested change
[Open a new pull request](https://github.com/firebase/firebase-admin-node/pull/new/main) and fill
[Open a new pull request](https://github.com/firebase/firebase-admin-node/pull/new) and fill

out the provided template.

**If you want to implement a new feature, please open an issue with a proposal first so that we can
Expand Down