Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions .github/workflows/check-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,19 @@ jobs:
check-commit-messages:
runs-on: ubuntu-latest
steps:
- name: "📜 Check commit messages format"
uses: gsactions/commit-message-checker@v1
- name: "⏳ Checkout repository"
uses: actions/checkout@v4
with:
pattern: '^[^!]+: [A-Za-z]+.+ .+\.$'
flags: "gm"
error: "Commit subject line must match the following pattern: <scope>: <description>."
excludeTitle: "false"
excludeDescription: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.GITHUB_TOKEN }}
- name: "📜 Check commit messages length"
uses: gsactions/commit-message-checker@v1
fetch-depth: 0

- name: "🟢 Set up Node.js"
uses: actions/setup-node@v4
with:
pattern: "^[^#].{10,78}$"
error: "Commit subject line maximum line length of 78 characters is exceeded."
excludeTitle: "false"
excludeDescription: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.GITHUB_TOKEN }}
node-version: "20"

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-node is configured with node-version: "20", but package.json requires Node >=20.17. If GitHub’s latest 20.x ever resolves below 20.17, npm ci will fail due to the engine check. Consider pinning to 20.17 (or 20.17.x) here to match the repo’s declared minimum and make CI deterministic.

Suggested change
node-version: "20"
node-version: "20.17.x"

Copilot uses AI. Check for mistakes.
cache: "npm"

- name: "🛠 Install commitlint"
run: npm ci

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm ci will run lifecycle scripts, including the repo’s prepare script (make prepare -> husky). That’s unnecessary for commitlint validation and can introduce CI flakiness/side effects. Consider running npm ci --ignore-scripts (and/or installing only commitlint) so the workflow doesn’t attempt to install git hooks during CI.

Suggested change
run: npm ci
run: npm ci --ignore-scripts

Copilot uses AI. Check for mistakes.

- name: "📜 Validate commit messages"
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To ensure this uses the repo’s installed/pinned commitlint (and fails if dependencies weren’t installed), consider adding --no-install to the npx commitlint ... invocation. This avoids npx falling back to downloading packages if the local install step changes in the future.

Suggested change
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
run: npx --no-install commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

Copilot uses AI. Check for mistakes.
Loading