Skip to content

Commit

Permalink
Merge pull request #184488 from Homebrew/dispatch-bottle-check
Browse files Browse the repository at this point in the history
workflows/dispatch-build-bottle: check for an existing bottle
  • Loading branch information
carlocab authored Sep 10, 2024
2 parents 9b66a81 + 5ff0b29 commit 3776ccb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/dispatch-build-bottle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,24 @@ jobs:
bottles-directory: ${{ env.BOTTLES_DIR }}
cleanup: ${{ matrix.cleanup }}

- name: Check for existing bottle
shell: brew ruby {0}
env:
HOMEBREW_DISPATCHED_FORMULA: ${{ inputs.formula }}
run: |
formula_name = ENV.fetch("HOMEBREW_DISPATCHED_FORMULA")
formula = Formulary.factory(formula_name)
current_bottle_tag = Utils::Bottles.tag
bottled_on_current_os = formula.bottle_specification.tag?(current_bottle_tag, no_older_versions: true)
return unless bottled_on_current_os
puts GitHub::Actions::Annotation.new(
:error,
"#{formula_name} already has a bottle for #{current_bottle_tag}!",
)
exit 1
- working-directory: ${{ env.BOTTLES_DIR }}
run: |
brew test-bot \
Expand Down

0 comments on commit 3776ccb

Please sign in to comment.