From 0b00e4c1aed4394b45457a77939f29c550805107 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 14 Jun 2024 09:34:37 +0900 Subject: [PATCH 1/4] ci: validate PR title against conventional commit rules --- .github/workflows/semantic-pr-check.yaml | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/semantic-pr-check.yaml diff --git a/.github/workflows/semantic-pr-check.yaml b/.github/workflows/semantic-pr-check.yaml new file mode 100644 index 000000000..261f90164 --- /dev/null +++ b/.github/workflows/semantic-pr-check.yaml @@ -0,0 +1,40 @@ +--- +name: "Semantic PR Title Check" +# Ensure that the PR title conforms to the Conventional Commits and our choice of types and scopes, so that library version bumps can be detected automatically + +on: + pull_request_target: + types: [opened, edited, synchronize] + +permissions: + pull-requests: read + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + chore + ci + docs + feat + fix + perf + refactor + revert + test + scopes: | + harness + deps + testing + pebble + model + framework + typing + charm + requireScope: false From a9b699acb14bff4f93bf49ac4bc03709c8fc2f18 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Tue, 18 Jun 2024 13:23:28 +0900 Subject: [PATCH 2/4] hack scopes; name the action for what it does --- .../{semantic-pr-check.yaml => validate-pr-title.yaml} | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) rename .github/workflows/{semantic-pr-check.yaml => validate-pr-title.yaml} (81%) diff --git a/.github/workflows/semantic-pr-check.yaml b/.github/workflows/validate-pr-title.yaml similarity index 81% rename from .github/workflows/semantic-pr-check.yaml rename to .github/workflows/validate-pr-title.yaml index 261f90164..4969f2802 100644 --- a/.github/workflows/semantic-pr-check.yaml +++ b/.github/workflows/validate-pr-title.yaml @@ -1,5 +1,5 @@ --- -name: "Semantic PR Title Check" +name: "Validate PR Title" # Ensure that the PR title conforms to the Conventional Commits and our choice of types and scopes, so that library version bumps can be detected automatically on: @@ -30,11 +30,5 @@ jobs: test scopes: | harness - deps - testing - pebble - model - framework - typing - charm + [a-z]{3,20} requireScope: false From e246880cc37ca5c410977aeb702bfcfeb283dccb Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Tue, 18 Jun 2024 13:26:54 +0900 Subject: [PATCH 3/4] concurrency control --- .github/workflows/validate-pr-title.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/validate-pr-title.yaml b/.github/workflows/validate-pr-title.yaml index 4969f2802..a81e6dac1 100644 --- a/.github/workflows/validate-pr-title.yaml +++ b/.github/workflows/validate-pr-title.yaml @@ -9,6 +9,10 @@ on: permissions: pull-requests: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: main: name: Validate PR title From 71b886031eeb715e7656a00750a502e10ff3d499 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Wed, 19 Jun 2024 10:36:33 +0900 Subject: [PATCH 4/4] fix: drop arbitrary scope --- .github/workflows/validate-pr-title.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/validate-pr-title.yaml b/.github/workflows/validate-pr-title.yaml index a81e6dac1..483a928b4 100644 --- a/.github/workflows/validate-pr-title.yaml +++ b/.github/workflows/validate-pr-title.yaml @@ -34,5 +34,4 @@ jobs: test scopes: | harness - [a-z]{3,20} requireScope: false