Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 51 additions & 3 deletions .github/workflows/check-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
grep -qF "Created by https://github.com/mislav/bump-homebrew-formula-action" "${RUNNER_TEMP}/check-prs/body"
then
echo "complete_template=true" >>"${GITHUB_OUTPUT:?}"
echo "has_description=true" >>"${GITHUB_OUTPUT}"
exit 0
fi
fi
Expand All @@ -100,15 +101,23 @@ jobs:
"${PR_TITLE}" \
"${GITHUB_REPOSITORY:?}"
)"
case "${complete_template}" in
true | false) ;;
has_description="$(
ruby "${RUNNER_TEMP}/check_template.rb" pull-request-description \
"${RUNNER_TEMP}/check-prs/body" \
"${RUNNER_TEMP}/check-prs/template" \
"${PR_TITLE}" \
"${GITHUB_REPOSITORY}"
)"
case "${complete_template}:${has_description}" in
true:true | true:false | false:true | false:false) ;;
*)
echo "Unexpected template completion result: ${complete_template}" >&2
echo "Unexpected template/description result: ${complete_template}:${has_description}" >&2
exit 1
;;
esac

echo "complete_template=${complete_template}" >>"${GITHUB_OUTPUT:?}"
echo "has_description=${has_description}" >>"${GITHUB_OUTPUT}"

- name: Find incomplete template comment
id: comments
Expand All @@ -133,6 +142,7 @@ jobs:
echo "closed_by=${closed_by}" >>"${GITHUB_OUTPUT:?}"

- name: Reopen completed pull request
id: reopen
if: >-
github.event.pull_request.state == 'closed' &&
steps.template.outputs.complete_template == 'true' &&
Expand Down Expand Up @@ -176,3 +186,41 @@ jobs:
run: |
gh api --method PATCH "repos/${GITHUB_REPOSITORY:?}/pulls/${PR_NUMBER:?}" \
-f state=closed

- name: Find missing description comment
id: description_comments
run: |
gh api --paginate "repos/${GITHUB_REPOSITORY:?}/issues/${PR_NUMBER:?}/comments" \
--jq '.[] | select(.user.login == "github-actions[bot]" and (.body | contains("<!-- missing-pr-description -->"))) | .id' \
>"${RUNNER_TEMP:?}/check-prs/missing-description-comment-ids"
if [[ -s "${RUNNER_TEMP}/check-prs/missing-description-comment-ids" ]]
then
echo "has_missing_description_comment=true" >>"${GITHUB_OUTPUT:?}"
else
echo "has_missing_description_comment=false" >>"${GITHUB_OUTPUT:?}"
fi

- name: Remove resolved description comments
if: >-
steps.template.outputs.has_description == 'true' &&
steps.description_comments.outputs.has_missing_description_comment == 'true'
run: |
while IFS= read -r comment_id
do
gh api --method DELETE "repos/${GITHUB_REPOSITORY:?}/issues/comments/${comment_id}"
done <"${RUNNER_TEMP:?}/check-prs/missing-description-comment-ids"

- name: Comment on missing description
if: >-
(github.event.pull_request.state != 'closed' || steps.reopen.outcome == 'success') &&
steps.template.outputs.complete_template == 'true' &&
steps.template.outputs.has_description == 'false' &&
steps.description_comments.outputs.has_missing_description_comment != 'true'
run: |
gh api --method POST "repos/${GITHUB_REPOSITORY:?}/issues/${PR_NUMBER:?}/comments" \
--raw-field body="$(
cat <<'COMMENT'
<!-- missing-pr-description -->
Please add a short description explaining what this pull request changes and why. This helps reviewers and makes the change easier to understand when investigating bugs later.
COMMENT
)"
6 changes: 2 additions & 4 deletions docs/Homebrew-Governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ Homebrew’s governance is grounded in the principle that only active contributo
- **Quarterly activity criteria**: Around 50 meaningful maintainer contributions per quarter to Primary Homebrew repositories to remain in good standing as a Maintainer.
Lead Maintainers have mandatory numerical requirements, defined below.
- **Quarter**: A Homebrew reporting quarter, defined as one of the following periods: December–February, March–May, June–August, or September–November.
Monthly reporting covers the Maintainers listed in Homebrew/brew's README at the end of the month.
Contribution counts cover that month; the `maintainer met` and `lead met` columns assess the latest completed quarter.
The report's `potential new role` column uses up to four full quarters of monthly or historical quarterly reports to apply multi-quarter role requirements.
Recommendations are omitted when the history required for the relevant activity check is incomplete.
Quarterly reporting covers the Maintainers listed in Homebrew/brew's README at the end of the quarter.
The report's `potential new role` column uses preceding full quarterly reports to apply multi-quarter role requirements.
Its recommendations require review against Maintainer discretion, Security and Ops Team exceptions and non-numerical eligibility criteria before role changes are made.
- **Meaningful maintainer contributions**: Merged pull requests by the Maintainer, pull requests created by others that GitHub reports as both reviewed and approved by the Maintainer, or merged co-authored commits in Primary Homebrew repositories.
A pull request opened and merged by the same Maintainer counts only once for that Maintainer.
Expand Down
Loading