Skip to content

Commit

Permalink
publish-commit-bottles: publish bottles only for formulae changes
Browse files Browse the repository at this point in the history
We occasionally see this workflow mistakenly attempting to publish
bottles for PRs that do not modify any formulae.

See, for example, #196103.
  • Loading branch information
carlocab committed Oct 30, 2024
1 parent 8b2c36a commit 0dbfe35
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/publish-commit-bottles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ jobs:
fi
done < <(jq --raw-output '.labels[].name' <<< "$pr_data")
if [[ "$bottles" = "true" ]]
then
if jq --exit-status 'any(.[].filename; startswith("Formula/")) | not'
then
echo '::notice ::PR does not modify formulae; no bottles to publish.'
bottles=false
fi < <(
gh api \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
"repos/$GH_REPO/pulls/$PR/files"
)
fi
requires_merge=true
if [[ "$merged" = "true" || "$automerge_enabled" = "true" ]]
then
Expand Down

0 comments on commit 0dbfe35

Please sign in to comment.