summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-11-05 11:04:46 +0100
committerGitHub <[email protected]>2022-11-05 11:04:46 +0100
commit517cbc069a22252dc4ff0a5d70000bba250d944e (patch)
tree57e2bbb66b20eecdf47a980de8f3963d6cdfad76 /.github
parentf0ed89d17c88aa65109d52f644e1221d596b82e7 (diff)
ci: test commitlint on pr title (#3262)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/commitlint.yml30
1 files changed, 18 insertions, 12 deletions
diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml
index 400b0bd0..4e4941a4 100644
--- a/.github/workflows/commitlint.yml
+++ b/.github/workflows/commitlint.yml
@@ -1,20 +1,26 @@
name: "Commit Linter"
on:
- pull_request:
- branches:
- - "rolling"
-
+ pull_request: # By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened.
+ types:
+ - opened
+ - edited
+ - synchronize
+ - reopened
jobs:
- lint-commits:
+ lint-pr-title:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ HELP_URL: "https://github.com/LunarVim/LunarVim/blob/rolling/CONTRIBUTING.md#commit-messages"
+ COMMITLINT_CONFIG: ${{ format('{0}/.github/workflows/commitlint.config.js', github.workspace) }}
+ GH_REPO: ${{ github.repository }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ PR_TITLE: ${{ github.event.pull_request.title }}
steps:
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - uses: wagoid/commitlint-github-action@v5
- with:
- configFile: .github/workflows/commitlint.config.js
- helpURL: https://github.com/LunarVim/LunarVim/blob/rolling/CONTRIBUTING.md#commit-messages
- firstParent: true
+ - name: install commitlint
+ run: |
+ npm install --save-dev @commitlint/cli
+ - name: run commitlint
+ run: |
+ echo "$PR_TITLE" | npx commitlint --verbose --help-url "$HELP_URL" --config "$COMMITLINT_CONFIG"