github: add webhook formality check

Replace the external formality check GitHub Action with a lightweight
webhook managed by the openwrt-bot-worker engine.

Using a webhook instead of a heavy GitHub Action workflow is much more
suitable for quick formality checks. GitHub Actions are constrained by
concurrency limits across repositories, often causing long delays. In
contrast, the webhook validates commits near-instantly.

The validation rules are configured via `.github/formalities.json`. Since
verifying `PKG_VERSION`, `PKG_RELEASE`, and mandatory release notes are
not relevant for the LuCI repository (unlike packages), these checks are
disabled.

Additionally, the formality check is now a hard requirement. The build
workflow will only run once the formality check passes, saving runner
resources.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
This commit is contained in:
Josef Schlehofer
2026-07-01 20:26:49 +02:00
parent 3e3adfed54
commit 5606383b19
3 changed files with 43 additions and 29 deletions
+26
View File
@@ -0,0 +1,26 @@
{
"check_branch": true,
"check_merge_commits": true,
"check_noreply_email": true,
"check_signoff": true,
"check_signature": true,
"allow_autosquash": true,
"enable_comments": true,
"max_subject_len_soft": 60,
"max_subject_len_hard": 80,
"max_body_line_len": 100,
"warn_duplicate_body": true,
"warn_generic_subjects": true,
"require_release_notes": false,
"require_body": true,
"check_pkg_version": false,
"check_crlf": true,
"add_package_label": true,
"drop_package_label": true,
"branch_labeling": true,
"check_openwrt_meta": ["PKG_MAINTAINER", "PKG_LICENSE"],
"check_conffiles": true,
"check_patch_headers": true,
"check_pkg_release": "disabled",
"require_linked_github_account": true
}
+17
View File
@@ -3,8 +3,25 @@ name: Test Build
on:
pull_request:
permissions:
contents: read
checks: read
jobs:
wait-for-formalities:
name: Wait for FormalityCheck
runs-on: ubuntu-slim
steps:
- name: Wait for Check Run
uses: lewagon/wait-on-check-action@v1.8.0
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: 'FormalityCheck / Git & Commits'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 5
build:
needs: wait-for-formalities
uses: openwrt/actions-shared-workflows/.github/workflows/multi-arch-test-build.yml@main
with:
matrix: '{"include": [{"arch": "x86_64", "target": "x86-64"}]}'
-29
View File
@@ -1,29 +0,0 @@
name: Test Formalities
on:
pull_request_target:
permissions:
contents: read
pull-requests: write
jobs:
formalities:
name: Test Formalities
runs-on: ubuntu-slim
steps:
- name: Run HyperStickler
uses: georgesapkin/hyperstickler@v1
with:
check_branch: true
check_signoff: true
exclude_weblate: true
feedback_url: 'https://github.com/openwrt/actions-shared-workflows/issues'
guideline_url: 'https://openwrt.org/submitting-patches#submission_guidelines'
job_step: 2
max_subject_len_soft: 78
max_subject_len_hard: 80
max_body_line_len: 80
post_comment: true
warn_on_no_modify: true