Skip to content

Commit 4cfa384

Browse files
committed
Skip brew if already published
1 parent 3c0799f commit 4cfa384

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

ci/steps/brew-bump.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ main() {
1919
echo "Adding Homebrew/homebrew-core as $(upstream)"
2020
git remote add upstream https://github.com/Homebrew/homebrew-core.git
2121

22-
echo "Fetching upstream commits..."
22+
echo "Fetching upstream Homebrew/hombrew-core commits"
2323
git fetch upstream
2424

25-
echo "Merging in latest changes"
25+
echo "Merging in latest Homebrew/homebrew-core changes"
2626
git merge upstream/master
2727

2828
echo "Pushing changes to cdrci/homebrew-core fork on GitHub"
@@ -37,7 +37,15 @@ main() {
3737

3838
# Find the docs for bump-formula-pr here
3939
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18
40-
brew bump-formula-pr --force --version="${VERSION}" code-server --no-browse --no-audit
40+
local output
41+
if ! output=$(brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit 2>&1); then
42+
if [[ $output == *"Duplicate PRs should not be opened"* ]]; then
43+
echo "$VERSION is already submitted"
44+
else
45+
echo "$output"
46+
exit 1
47+
fi
48+
fi
4149

4250
# Clean up and remove homebrew-core
4351
cd ..

0 commit comments

Comments
 (0)