From be0360a75b98c292d643b8eae3dee8741debaf62 Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Mon, 24 Nov 2025 14:33:56 -0700 Subject: [PATCH] chore: add conventional commit linting --- .github/dependabot.yml | 8 ++++++ .github/workflows/automatic-api-update.yaml | 3 +- .github/workflows/lint.yaml | 32 +++++++++++++++++++++ .github/workflows/manual-api-update.yaml | 7 +++-- .github/workflows/test.yaml | 16 ++++------- 5 files changed, 52 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e44a855..8db8917 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,6 +10,10 @@ updates: groups: npm: patterns: ["*"] + commit-message: + prefix: "chore" + prefix-development: "chore" + include: "scope" - package-ecosystem: "github-actions" directory: "/" schedule: @@ -17,3 +21,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 def69de..4bf4296 100644 --- a/.github/workflows/automatic-api-update.yaml +++ b/.github/workflows/automatic-api-update.yaml @@ -40,8 +40,9 @@ jobs: with: delete-branch: "true" title: "Update API to ${{ github.event.client_payload.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/${{ github.event.client_payload.BUFTAG }}" base: "main" - token: ${{ secrets.GITHUB_TOKEN }} + token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..7639f5d --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,32 @@ +--- +name: "Lint" +permissions: + contents: "read" +on: + push: + branches: + - "main" + pull_request: + branches: + - "*" +jobs: + lint: + name: "Lint" + runs-on: "depot-ubuntu-24.04-small" + steps: + - uses: "actions/checkout@v5" + - uses: "bahmutov/npm-install@v1" + with: + useLockFile: false + - name: "Run prettier" + run: "CI=true yarn run prettier src -c" + - name: "Run lint" + run: "CI=true yarn lint" + + 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@v5" + - 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 5dacde7..ecbc6ea 100644 --- a/.github/workflows/manual-api-update.yaml +++ b/.github/workflows/manual-api-update.yaml @@ -40,9 +40,10 @@ jobs: if: steps.buf-update.outputs.updated == 'true' with: delete-branch: "true" - title: Update API to ${{ inputs.buftag }} + 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 }} + branch: "api-change/${{ inputs.buftag }}" base: "main" - token: ${{ secrets.GITHUB_TOKEN }} + token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7ec3bcf..68ec786 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,5 @@ --- -name: "Lint and Test" +name: "Test" on: push: branches: @@ -25,7 +25,7 @@ jobs: - js-dist/package.json - buf.gen.yaml test: - name: Lint and Test + name: "Test" runs-on: "depot-ubuntu-24.04-small" strategy: matrix: @@ -34,26 +34,22 @@ jobs: if: | needs.paths-filter.outputs.codechange == 'true' steps: - - uses: actions/checkout@v5 + - uses: "actions/checkout@v5" - uses: "authzed/action-spicedb@v1" with: version: "latest" - - uses: actions/setup-node@v6 + - uses: "actions/setup-node@v6" with: node-version: ${{ matrix.node-version }} cache-dependency-path: ./package.json cache: "yarn" - - uses: bahmutov/npm-install@v1 + - uses: "bahmutov/npm-install@v1" with: useLockFile: false - - name: Run lint - run: "CI=true yarn lint" - - name: Run prettier - run: "CI=true yarn run prettier src -c" - name: Run Yarn tests run: "CI=true yarn only-run-tests" build-js-client: - name: Build and Test JS client + name: "Build and Test JS client" runs-on: "depot-ubuntu-24.04-small" strategy: matrix: