From ea7fa6c56854a1f193a2cb40f47dd4605e69bbd2 Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Mon, 24 Nov 2025 14:35:13 -0700 Subject: [PATCH] chore: add conventional commit linting --- .github/dependabot.yml | 8 ++++++++ .github/workflows/automatic-api-update.yaml | 6 +++++- .github/workflows/build.yaml | 8 ++++---- .github/workflows/lint.yaml | 20 ++++++++++++++++++++ .github/workflows/manual-api-update.yaml | 9 ++++++--- 5 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4174a02a..f1634ff5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,6 +7,10 @@ updates: groups: gradle: patterns: ["*"] + commit-message: + prefix: "chore" + prefix-development: "chore" + include: "scope" - package-ecosystem: "github-actions" directory: "/" schedule: @@ -14,3 +18,7 @@ updates: groups: github-actions: patterns: ["*"] + commit-message: + prefix: "chore" + prefix-development: "chore" + include: "scope" diff --git a/.github/workflows/automatic-api-update.yaml b/.github/workflows/automatic-api-update.yaml index 68eaff89..a9e86f20 100644 --- a/.github/workflows/automatic-api-update.yaml +++ b/.github/workflows/automatic-api-update.yaml @@ -35,5 +35,9 @@ jobs: with: delete-branch: "true" title: "Update API to ${{ github.event.client_payload.BUFTAG }}" + commit-message: "chore: update api version" branch: "api-change/${{ github.event.client_payload.BUFTAG }}" - token: ${{ secrets.GITHUB_TOKEN }} + # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs + # This is how we ensure that workflows run + draft: "always-true" + token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8f54f4aa..0b5432ab 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,11 +9,11 @@ on: - "*" types: # NOTE: these are the defaults - - opened - - synchronize - - reopened + - "opened" + - "synchronize" + - "reopened" # NOTE: we add this to let the conversion from draft trigger the workflows - - ready_for_review + - "ready_for_review" merge_group: types: - "checks_requested" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..7e07a72d --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,20 @@ +--- +name: "Lint" +on: # yamllint disable-line rule:truthy + push: + branches: + - "!dependabot/*" + - "main" + pull_request: + branches: ["*"] + merge_group: + types: + - "checks_requested" +jobs: + conventional-commits: + name: "Lint Commit Messages" + runs-on: "depot-ubuntu-24.04-small" + if: "github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.action == 'reopened' || github.event.action == 'edited')" + steps: + - uses: "actions/checkout@v6" + - uses: "webiny/action-conventional-commits@v1.3.0" diff --git a/.github/workflows/manual-api-update.yaml b/.github/workflows/manual-api-update.yaml index 317f66a6..d8661002 100644 --- a/.github/workflows/manual-api-update.yaml +++ b/.github/workflows/manual-api-update.yaml @@ -38,6 +38,9 @@ jobs: if: steps.buf-update.outputs.updated == 'true' with: delete-branch: "true" - title: Update API to ${{ inputs.buftag }} - branch: api-change/${{ inputs.buftag }} - token: ${{ secrets.GITHUB_TOKEN }} + title: "Update API to ${{ inputs.buftag }}" + commit-message: "chore: update api version" + # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs + draft: "always-true" + branch: "api-change/${{ inputs.buftag }}" + token: "${{ secrets.GITHUB_TOKEN }}"