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>
42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
name: pr-rules
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
# edited reruns the check after the description is fixed, without rerunning pkgcheck
|
|
types: [opened, reopened, synchronize, edited]
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
pr-rules:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: check the commit rules
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
PR: ${{ github.event.pull_request.number }}
|
|
run: |
|
|
bad=$(scripts/commit-rules.sh "$PR")
|
|
if [ -n "$bad" ]; then
|
|
printf '%s\n' "$bad"
|
|
exit 1
|
|
fi
|
|
|
|
- name: check that the pull request template is kept
|
|
if: ${{ !cancelled() }}
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
PR: ${{ github.event.pull_request.number }}
|
|
run: |
|
|
missing=$(scripts/pr-template.sh "$PR")
|
|
if [ -n "$missing" ]; then
|
|
printf 'The description lost these checkboxes of the pull request template:\n%s\n' "$missing"
|
|
exit 1
|
|
fi
|