Skip to content

Commit 8ad4020

Browse files
committed
feat(brew-bump): check HOMEBREW_GITHUB_API_TOKEN
1 parent ead156b commit 8ad4020

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

ci/steps/brew-bump.sh

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ main() {
1515
exit 1
1616
fi
1717

18+
# We need HOMEBREW_GITHUB_API_TOKEN to push up commits
19+
if [[ $(is_env_var_set "HOMEBREW_GITHUB_API_TOKEN") -eq 1 ]]; then
20+
echo "HOMEBREW_GITHUB_API_TOKEN is not set"
21+
exit 1
22+
fi
23+
1824
# NOTE: we need to make sure cdrci/homebrew-core
1925
# is up-to-date
2026
# otherwise, brew bump-formula-pr will use an

test/scripts/steps-lib.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ SCRIPT="$BATS_TEST_DIRNAME/../../ci/steps/$SCRIPT_NAME"
55

66
source "$SCRIPT"
77

8-
@test "is_env_var_set should return false if env var is not set" {
8+
@test "is_env_var_set should return 1 if env var is not set" {
99
run is_env_var_set "ASDF_TEST_SET"
1010
[ "$output" = 1 ]
1111
}
1212

13-
@test "is_env_var_set should return true if env var is set" {
13+
@test "is_env_var_set should return 0 if env var is set" {
1414
ASDF_TEST_SET="test" run is_env_var_set "ASDF_TEST_SET"
1515
[ "$output" = 0 ]
1616
}

0 commit comments

Comments
 (0)