Contributors delete the template, so reviewers cannot see whether pkgcheck ran or AI was used. The boxes stay optional because not every contributor can run pkgcheck with --net and the AI box applies only when AI was used. The autobump bot does not fill in the template and is skipped. The commit rules move from pkgcheck into the same workflow, because both checks read the pull request rather than the ebuilds and must rerun when the description is edited, which pkgcheck should not. pkgcheck-comment now also closes a pull request without the template, and its reply lists the commit and template problems in separate sections. Signed-off-by: Zakk <zakk@gentoozh.org>
12 lines
596 B
Bash
Executable File
12 lines
596 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# usage: pr-template.sh <pull request number>
|
|
# prints the checkboxes of .github/pull_request_template.md missing from the pull request description
|
|
set -euo pipefail
|
|
pr=$(gh api "repos/$GITHUB_REPOSITORY/pulls/${1:?pull request number}")
|
|
[ "$(jq -r .user.login <<< "$pr")" != 'gentoo-zh-autobump[bot]' ] || exit 0
|
|
body=$(jq -r '.body // ""' <<< "$pr")
|
|
# shellcheck disable=SC2016 # literal backticks of the template
|
|
for box in 'I have run `pkgcheck scan --commits --net`' 'If I used AI:'; do
|
|
grep -iF -- "$box" <<< "$body" | grep -qE '^- \[[ xX]\] ' || echo "- $box"
|
|
done
|