ci: Replace Node.js setup with Bun for commitlint installation in PR validation workflow
This commit is contained in:
1 file changed
+6
-11
@@ -8,9 +8,6 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
NODE_VERSION: '24'
|
||||
|
||||
jobs:
|
||||
lint-commits-and-pr:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -40,13 +37,11 @@ jobs:
|
||||
curl --silent --show-error --fail --location --output commitlint.config.js "$url"
|
||||
echo "config=commitlint.config.js" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install commitlint
|
||||
run: npm install --no-save @commitlint/cli @commitlint/config-conventional
|
||||
run: bun add --no-save @commitlint/cli @commitlint/config-conventional
|
||||
|
||||
- name: Validate PR Title & Description (<= 500 chars)
|
||||
env:
|
||||
@@ -55,9 +50,9 @@ jobs:
|
||||
COMMITLINT_CONFIG: ${{ steps.commitlint-config.outputs.config }}
|
||||
run: |
|
||||
if [ -z "$PR_BODY" ]; then
|
||||
printf "%s\n" "$PR_TITLE" | npx commitlint --config "$COMMITLINT_CONFIG"
|
||||
printf "%s\n" "$PR_TITLE" | bunx commitlint --config "$COMMITLINT_CONFIG"
|
||||
else
|
||||
printf "%s\n\n%s\n" "$PR_TITLE" "$PR_BODY" | npx commitlint --config "$COMMITLINT_CONFIG"
|
||||
printf "%s\n\n%s\n" "$PR_TITLE" "$PR_BODY" | bunx commitlint --config "$COMMITLINT_CONFIG"
|
||||
fi
|
||||
|
||||
- name: Validate All Commits in PR
|
||||
@@ -66,4 +61,4 @@ jobs:
|
||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
COMMITLINT_CONFIG: ${{ steps.commitlint-config.outputs.config }}
|
||||
run: |
|
||||
npx commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --verbose --config "$COMMITLINT_CONFIG"
|
||||
bunx commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --verbose --config "$COMMITLINT_CONFIG"
|
||||
Reference in new issue
Block a user