Skip to content

Commit 3e07544

Browse files
committed
feat(brew-bump): add check for git-askpass.sh
1 parent 1a78afe commit 3e07544

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ci/steps/brew-bump.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,23 @@ main() {
6060
echo "Pushing changes to cdrci/homebrew-core fork on GitHub"
6161
# Source: https://serverfault.com/a/912788
6262
# shellcheck disable=SC2016,SC2028
63-
echo '#!/bin/sh\nexec echo "$HOMEBREW_GITHUB_API_TOKEN"' > "$HOME"/.git-askpass.sh
63+
echo '#!/bin/sh\nexec echo "$HOMEBREW_GITHUB_API_TOKEN"' > "$HOME"/git-askpass.sh
64+
65+
# Make sure the git-askpass.sh file creation is successful
66+
if [[ $(file_exists "git-askpass.sh") -eq 1 ]]; then
67+
echo "git-askpass.sh not found in $HOME."
68+
ls -la "$HOME"
69+
exit 1
70+
fi
6471

6572
# TODO@jsjoeio - check that git-askpass.sh was created
6673
# Ensure it's executable since we just created it
67-
chmod +x "$HOME/.git-askpass.sh"
74+
chmod +x "$HOME/git-askpass.sh"
6875

6976
# TODO@jsjoeio - check that git-askpass.sh has executable permissions
7077
# GIT_ASKPASS lets us use the password when pushing without revealing it in the process list
7178
# See: https://serverfault.com/a/912788
72-
GIT_ASKPASS="$HOME/.git-askpass.sh" git push https://[email protected]/cdr-oss/homebrew-core.git --all
79+
GIT_ASKPASS="$HOME/git-askpass.sh" git push https://[email protected]/cdr-oss/homebrew-core.git --all
7380

7481
# Find the docs for bump-formula-pr here
7582
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18

0 commit comments

Comments
 (0)