From 017d2332268ce176ad64bd21ea7b667bede871cf Mon Sep 17 00:00:00 2001 From: Libin YANG Date: Thu, 25 Jun 2026 19:02:17 +0800 Subject: [PATCH] chore(ci): upgrade GitHub Actions to latest major versions Bump official actions to v5-v7, pin third-party actions to releases, fix prettier_action v4.6 file pattern, and align pnpm with packageManager for frozen lockfile installs. Co-authored-by: Cursor --- .github/workflows/compress.yml | 6 +++--- .github/workflows/deploy.yml | 26 +++++++------------------- .github/workflows/prettier.yml | 7 ++++--- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/.github/workflows/compress.yml b/.github/workflows/compress.yml index a5a7a1c..0667b69 100644 --- a/.github/workflows/compress.yml +++ b/.github/workflows/compress.yml @@ -16,11 +16,11 @@ jobs: if: github.repository == 'doocs/coding-interview' steps: - name: Checkout Branch - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Compress Images id: calibre - uses: calibreapp/image-actions@main + uses: calibreapp/image-actions@1.5.0 with: githubToken: ${{ secrets.ACTION_TOKEN }} compressOnly: true @@ -36,6 +36,6 @@ jobs: - name: Push Changes if: | steps.calibre.outputs.markdown != '' - uses: ad-m/github-push-action@master + uses: ad-m/github-push-action@v1.3.0 with: github_token: ${{ secrets.ACTION_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 33dd453..f943649 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,29 +9,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 + - uses: pnpm/action-setup@v6 + - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: 22 - - - uses: pnpm/action-setup@v4 - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v4 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile @@ -43,7 +31,7 @@ jobs: run: echo "interview.doocs.org" > docs/.vitepress/dist/CNAME - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5 with: path: docs/.vitepress/dist @@ -59,4 +47,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 9bbeec2..0dfe8f2 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -12,14 +12,15 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: ref: ${{ github.head_ref }} - name: Prettify code - uses: creyD/prettier_action@v3.3 + uses: creyD/prettier_action@v4.6 with: - prettier_options: --write **/*.{md} + file_pattern: "**/*.md" + prettier_options: --write commit_message: "style: prettify code" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}