fix(ci): update pr title workflow

This commit is contained in:
Philipp Kief 2025-02-28 18:42:42 +01:00
parent 050bdf5883
commit 8363871028
No known key found for this signature in database
GPG Key ID: A8C6D8A9108F37B2
2 changed files with 16 additions and 10 deletions

View File

@ -6,7 +6,6 @@ on:
permissions:
pull-requests: write
issues: write # Update issue labels
jobs:
lint-pr-title:
@ -23,7 +22,6 @@ jobs:
# Only fetch the config file from the repository
sparse-checkout-cone-mode: false
sparse-checkout: |
.github/scripts/update-status-label.sh
commitlint.config.js
- name: 📦 Install dependencies
@ -33,11 +31,4 @@ jobs:
id: title-check
env:
PR_TITLE: ${{ github.event.pull_request.title }}
HELP_URL: https://github.com/material-extensions/vscode-material-icon-theme/blob/main/CONTRIBUTING.md#conventional-pull-request-titles
run: echo "$PR_TITLE" | npx commitlint --help-url $HELP_URL
- name: 🏷️ Manage label based on PR title check result
if: always()
run: .github/scripts/update-status-label.sh ${{ github.event.pull_request.number }} ${{ steps.title-check.outcome }} "🔤 invalid title"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "$PR_TITLE" | npx commitlint

15
commitlint.config.js Normal file
View File

@ -0,0 +1,15 @@
/**
* @type {import('@commitlint/types').UserConfig}
*/
const config = {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-case': [
0,
'always',
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
],
},
};
module.exports = config;