From 8eea8dd766f64633fe68b70ca311718c33657180 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 2 Jan 2025 17:39:18 +0100 Subject: [PATCH 1/7] [infra] Add commit message checker --- .github/workflows/commit-message.yaml | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/commit-message.yaml diff --git a/.github/workflows/commit-message.yaml b/.github/workflows/commit-message.yaml new file mode 100644 index 000000000..f292bef17 --- /dev/null +++ b/.github/workflows/commit-message.yaml @@ -0,0 +1,29 @@ +name: 'Commit Message Check' +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + pull_request_target: + types: + - opened + - edited + - reopened + - synchronize + push: + branches: + - main + +jobs: + check-commit-message: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - name: Check Commit Type + uses: gsactions/commit-message-checker@v2 + with: + pattern: '\[[^]]+\] .+$' + flags: 'gm' + error: 'Your first line has to contain a package name like "[ffigen]", or "[infra]".' From 00db5780482dceefb6db098ac7dbf7d0e89102ce Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 2 Jan 2025 17:54:17 +0100 Subject: [PATCH 2/7] try a different one --- .github/pr-title-checker-config.json | 15 +++++++++++++ .github/workflows/commit-message.yaml | 29 ------------------------- .github/workflows/pr-title-checker.yaml | 18 +++++++++++++++ 3 files changed, 33 insertions(+), 29 deletions(-) create mode 100644 .github/pr-title-checker-config.json delete mode 100644 .github/workflows/commit-message.yaml create mode 100644 .github/workflows/pr-title-checker.yaml diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 000000000..4a2ab7012 --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,15 @@ +{ + "LABEL": { + "name": "The PR title has to contain a package name like \"[ffigen]\", or \"[infra]\".", + "color": "EEEEEE" + }, + "CHECKS": { + "regexp": "\\[[^]]+\\] .+", + "regexpFlags": "i" + }, + "MESSAGES": { + "success": "All OK", + "failure": "Failing CI test", + "notice": "" + } +} diff --git a/.github/workflows/commit-message.yaml b/.github/workflows/commit-message.yaml deleted file mode 100644 index f292bef17..000000000 --- a/.github/workflows/commit-message.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: 'Commit Message Check' -on: - pull_request: - types: - - opened - - edited - - reopened - - synchronize - pull_request_target: - types: - - opened - - edited - - reopened - - synchronize - push: - branches: - - main - -jobs: - check-commit-message: - name: Check Commit Message - runs-on: ubuntu-latest - steps: - - name: Check Commit Type - uses: gsactions/commit-message-checker@v2 - with: - pattern: '\[[^]]+\] .+$' - flags: 'gm' - error: 'Your first line has to contain a package name like "[ffigen]", or "[infra]".' diff --git a/.github/workflows/pr-title-checker.yaml b/.github/workflows/pr-title-checker.yaml new file mode 100644 index 000000000..063e7f495 --- /dev/null +++ b/.github/workflows/pr-title-checker.yaml @@ -0,0 +1,18 @@ +name: "PR Title Checker" +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - labeled + - unlabeled + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: thehanimo/pr-title-checker@v1.4.3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pass_on_octokit_error: false From 924f4b5dfb0f34fc6dbbb32c45a3c1c0033baa42 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 2 Jan 2025 18:00:24 +0100 Subject: [PATCH 3/7] try again --- .github/pr-title-checker-config.json | 4 ++++ .github/workflows/pr-title-checker.yaml | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index 4a2ab7012..f9304c5d3 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -4,6 +4,10 @@ "color": "EEEEEE" }, "CHECKS": { + "prefixes": [ + "[infra] ", + "[ffigen] " + ], "regexp": "\\[[^]]+\\] .+", "regexpFlags": "i" }, diff --git a/.github/workflows/pr-title-checker.yaml b/.github/workflows/pr-title-checker.yaml index 063e7f495..22eebcfc2 100644 --- a/.github/workflows/pr-title-checker.yaml +++ b/.github/workflows/pr-title-checker.yaml @@ -1,9 +1,16 @@ name: "PR Title Checker" on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize pull_request_target: types: - opened - edited + - reopened - synchronize - labeled - unlabeled From 1686cbea8e59032619a099ab0a1980a0b8c1c933 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 2 Jan 2025 18:03:16 +0100 Subject: [PATCH 4/7] list prefixes --- .github/pr-title-checker-config.json | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index f9304c5d3..a7df8c9e0 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -5,11 +5,18 @@ }, "CHECKS": { "prefixes": [ + "[ffi] ", + "[ffigen] ", "[infra] ", - "[ffigen] " - ], - "regexp": "\\[[^]]+\\] .+", - "regexpFlags": "i" + "[jni] ", + "[jnigen] ", + "[native_assets_builder] ", + "[native_assets_cli] ", + "[native_toolchain_c] ", + "[objective_c] ", + "[swift2objc] ", + "[swiftgen] " + ] }, "MESSAGES": { "success": "All OK", From a3008423c6ca7dbb88162e289c08877b5e954990 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 2 Jan 2025 18:21:01 +0100 Subject: [PATCH 5/7] try-label-config --- .github/pr-title-checker-config.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index a7df8c9e0..1b59db904 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -1,7 +1,7 @@ { "LABEL": { - "name": "The PR title has to contain a package name like \"[ffigen]\", or \"[infra]\".", - "color": "EEEEEE" + "name": "pr-title", + "color": "660000" }, "CHECKS": { "prefixes": [ @@ -20,7 +20,7 @@ }, "MESSAGES": { "success": "All OK", - "failure": "Failing CI test", + "failure": "The PR title has to contain a package name like \"[ffigen]\", or \"[infra]\".", "notice": "" } } From c47590de9e1e5da4a0606d79bb84f7c446180b82 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 2 Jan 2025 18:25:23 +0100 Subject: [PATCH 6/7] address comments --- .github/pr-title-checker-config.json | 7 +++---- .github/workflows/pr-title-checker.yaml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index 1b59db904..04ce3fafb 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -1,8 +1,4 @@ { - "LABEL": { - "name": "pr-title", - "color": "660000" - }, "CHECKS": { "prefixes": [ "[ffi] ", @@ -16,6 +12,9 @@ "[objective_c] ", "[swift2objc] ", "[swiftgen] " + ], + "ignoreLabels": [ + "ignore-pr-title" ] }, "MESSAGES": { diff --git a/.github/workflows/pr-title-checker.yaml b/.github/workflows/pr-title-checker.yaml index 22eebcfc2..8f3e6521b 100644 --- a/.github/workflows/pr-title-checker.yaml +++ b/.github/workflows/pr-title-checker.yaml @@ -19,7 +19,7 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: thehanimo/pr-title-checker@v1.4.3 + - uses: thehanimo/pr-title-checker@7fbfe05602bdd86f926d3fb3bccb6f3aed43bc70 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} pass_on_octokit_error: false From de0d35675c5d46396e534ddadf5c72ebefdb23e2 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 2 Jan 2025 18:26:38 +0100 Subject: [PATCH 7/7] make skip label consistent with health checks --- .github/pr-title-checker-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index 04ce3fafb..03841f3f1 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -14,7 +14,7 @@ "[swiftgen] " ], "ignoreLabels": [ - "ignore-pr-title" + "skip-pr-title-check" ] }, "MESSAGES": {