From adf7460b45d795fa7e46c0dcd1a020817cd83083 Mon Sep 17 00:00:00 2001 From: tienbh Date: Fri, 27 Nov 2026 10:58:12 +0700 Subject: [PATCH] ci: Replace Node.js setup with Bun for commitlint installation in PR validation workflow --- .gitea/scoped_workflows/commits-validation.yaml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.gitea/scoped_workflows/commits-validation.yaml b/.gitea/scoped_workflows/commits-validation.yaml index 4287298..d99a928 100644 --- a/.gitea/scoped_workflows/commits-validation.yaml +++ b/.gitea/scoped_workflows/commits-validation.yaml @@ -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"