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 @@ -145,8 +145,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
echo ""

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

- name: Send email on failure
if: failure()
uses: firebase/firebase-admin-node/.github/actions/send-email@master
uses: firebase/firebase-admin-node/.github/actions/send-email@main
with:
api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }}
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
Expand All @@ -93,7 +93,7 @@ jobs:

- name: Send email on cancelled
if: cancelled()
uses: firebase/firebase-admin-node/.github/actions/send-email@master
uses: firebase/firebase-admin-node/.github/actions/send-email@main
with:
api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }}
domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ 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' &&
github.ref == 'refs/heads/main' &&
contains(github.event.pull_request.labels.*.name, 'release:publish') &&
startsWith(github.event.pull_request.title, '[chore] Release ')

Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
- name: Post to Twitter
if: success() &&
contains(github.event.pull_request.labels.*.name, 'release:tweet')
uses: firebase/firebase-admin-node/.github/actions/send-tweet@master
uses: firebase/firebase-admin-node/.github/actions/send-tweet@main
with:
status: >
${{ steps.preflight.outputs.version }} of @Firebase Admin .NET SDK is available.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Great, we love hearing how we can improve our products! Share you idea through o

Sweet, we'd love to accept your contribution! In fact this project is mainly
driven by contributions from our community.
[Open a new pull request](https://github.com/firebase/firebase-admin-dotnet/pull/new/master) and fill
[Open a new pull request](https://github.com/firebase/firebase-admin-dotnet/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
6 changes: 3 additions & 3 deletions prepare_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ fi
# VALIDATE REPO #
###################

# Ensure the checked out branch is master
# Ensure the checked out branch is main
CHECKED_OUT_BRANCH="$(git branch | grep "*" | awk -F ' ' '{print $2}')"
if [[ $CHECKED_OUT_BRANCH != "master" ]]; then
read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'master'. Continue? (y/N) " CONTINUE
if [[ $CHECKED_OUT_BRANCH != "main" ]]; then
read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'main'. Continue? (y/N) " CONTINUE
Comment on lines +109 to +112

Choose a reason for hiding this comment

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

medium

The method for getting the current branch name is not very robust. It can fail in certain scenarios like a detached HEAD state. A more reliable way is to use git rev-parse --abbrev-ref HEAD.

Also, it's good practice to quote shell variables when they are used to prevent issues with spaces or other special characters in the value.

Suggested change
# Ensure the checked out branch is main
CHECKED_OUT_BRANCH="$(git branch | grep "*" | awk -F ' ' '{print $2}')"
if [[ $CHECKED_OUT_BRANCH != "master" ]]; then
read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'master'. Continue? (y/N) " CONTINUE
if [[ $CHECKED_OUT_BRANCH != "main" ]]; then
read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'main'. Continue? (y/N) " CONTINUE
# Ensure the checked out branch is main
CHECKED_OUT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [[ "$CHECKED_OUT_BRANCH" != "main" ]]; then
read -p "[WARN] You are on the '${CHECKED_OUT_BRANCH}' branch, not 'main'. Continue? (y/N) " CONTINUE

case $CONTINUE in
y|Y) ;;
*) echo "[INFO] You chose not to continue." ;
Expand Down