CI: migrate to webhook bot and simplify labeler
This commit migrates the repository validation to a webhook-based bot instead of the GitHub Actions workflow (.github/workflows/formal.yml). Since the bot handles stable branch labeling automatically (via the "branch_labeling: true" configuration option), the redundant branch check and labeling steps are removed from .github/workflows/labeler.yml. The following configuration choices are applied in formalities.json: - check_space_after_assignment: false (Disabled temporarily to catch any issues since it is a newly implemented check) - check_makefile_indentation: false (Disabled temporarily to catch any issues since it is a new feature) - check_patch_headers: 'warning' (Changed to warning instead of hard error since many legacy patches lack headers) - enable_stale_bot: false (Disabled for now) Other configurations can be adjusted in formalities.json based on the openwrt-bot-worker repository [1]. [1] https://github.com/openwrt/openwrt-bot-worker Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com> Link: https://github.com/openwrt/openwrt/pull/24256 (cherry picked from commit 9146f931b62e9b20df84566187a837b904df1e2f) Link: https://github.com/openwrt/openwrt/pull/24319 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commit a30deed6bd4348283e8e116014f7da0d8697fdc5)
This commit is contained in:
parent
9113b2c4bf
commit
743de64b48
28
.github/formalities.json
vendored
Normal file
28
.github/formalities.json
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"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": true,
|
||||||
|
"check_pkg_version": true,
|
||||||
|
"check_crlf": true,
|
||||||
|
"add_package_label": true,
|
||||||
|
"drop_package_label": true,
|
||||||
|
"branch_labeling": true,
|
||||||
|
"check_openwrt_meta": true,
|
||||||
|
"check_conffiles": true,
|
||||||
|
"check_patch_headers": "warning",
|
||||||
|
"check_space_after_assignment": false,
|
||||||
|
"check_makefile_indentation": false,
|
||||||
|
"check_pkg_release": "warning",
|
||||||
|
"require_linked_github_account": true,
|
||||||
|
"enable_stale_bot": false
|
||||||
|
}
|
||||||
18
.github/workflows/formal.yml
vendored
18
.github/workflows/formal.yml
vendored
@ -1,18 +0,0 @@
|
|||||||
name: Test Formalities
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Test Formalities
|
|
||||||
uses: openwrt/actions-shared-workflows/.github/workflows/formal.yml@main
|
|
||||||
# with:
|
|
||||||
# # Post formality check summaries to the PR.
|
|
||||||
# # Repo's permissions need to be updated for actions to modify PRs:
|
|
||||||
# # https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment
|
|
||||||
# post_comment: true
|
|
||||||
14
.github/workflows/labeler.yml
vendored
14
.github/workflows/labeler.yml
vendored
@ -17,17 +17,3 @@ jobs:
|
|||||||
- uses: actions/labeler@v6
|
- uses: actions/labeler@v6
|
||||||
with:
|
with:
|
||||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
|
||||||
- name: Check Branch
|
|
||||||
id: check-branch
|
|
||||||
run: |
|
|
||||||
if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then
|
|
||||||
echo "release-tag=$(echo ${{ github.base_ref }} | sed 's/openwrt-/release\//')" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: buildsville/add-remove-label@v2.0.1
|
|
||||||
if: ${{ steps.check-branch.outputs.release-tag }}
|
|
||||||
with:
|
|
||||||
token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
labels: ${{ steps.check-branch.outputs.release-tag }}
|
|
||||||
type: add
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user