From cb614dc93a61731b41c78a4087d2ec68e74266cf Mon Sep 17 00:00:00 2001 From: Victor Barua Date: Wed, 17 Dec 2025 13:15:26 -0800 Subject: [PATCH 1/2] ci: skip commitlint on commits --- .github/workflows/pr.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 517b34f7c..886b94ffc 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -17,17 +17,6 @@ jobs: fetch-depth: 0 - uses: editorconfig-checker/action-editorconfig-checker@v2 - run: editorconfig-checker - commitlint: - name: Lint commits for semantic-release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - uses: actions/setup-node@v6 - with: - node-version: "20" - - run: npx commitlint --from=${{ github.event.pull_request.base.sha }} --to=${{ github.sha }} --verbose security: name: Security validation runs-on: ubuntu-latest From 49463f963242901df3f5ce696de7a4700666bc28 Mon Sep 17 00:00:00 2001 From: Victor Barua Date: Wed, 17 Dec 2025 13:15:40 -0800 Subject: [PATCH 2/2] ci: enforce commitlint on PR title and description --- .github/workflows/pr_title.yaml | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/pr_title.yaml diff --git a/.github/workflows/pr_title.yaml b/.github/workflows/pr_title.yaml new file mode 100644 index 000000000..a9127fca6 --- /dev/null +++ b/.github/workflows/pr_title.yaml @@ -0,0 +1,63 @@ +name: PR Title Check + +on: + pull_request_target: + types: [opened, edited, synchronize, reopened] +jobs: + commitlint: + name: PR title / description conforms to semantic-release + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v6 + with: + node-version: "20" + - run: npm install @commitlint/config-conventional + - run: > + echo 'module.exports = { + // Workaround for https://github.com/dependabot/dependabot-core/issues/5923 + "ignores": [(message) => /^Bumps \[.+]\(.+\) from .+ to .+\.$/m.test(message)], + "rules": { + "body-max-line-length": [0, "always", Infinity], + "footer-max-line-length": [0, "always", Infinity], + "body-leading-blank": [0, "always"] + } + }' > .commitlintrc.js + - run: npx commitlint --extends @commitlint/config-conventional --verbose <<< $COMMIT_MSG + env: + COMMIT_MSG: > + ${{ github.event.pull_request.title }} + + ${{ github.event.pull_request.body }} + - if: failure() + uses: actions/github-script@v8 + with: + script: | + const message = `**ACTION NEEDED** + + Substrait follows the [Conventional Commits + specification](https://www.conventionalcommits.org/en/v1.0.0/) for + release automation. + + The PR title and description are used as the merge commit message.\ + Please update your PR title and description to match the specification. + ` + // Get list of current comments + const comments = await github.paginate(github.rest.issues.listComments, { + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number + }); + // Check if this job already commented + for (const comment of comments) { + if (comment.body === message) { + return // Already commented + } + } + // Post the comment about Conventional Commits + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: message + }) + core.setFailed(message)