From 4c7298695adb00228d0933d962348c5d9c65b520 Mon Sep 17 00:00:00 2001 From: Northword <44738481+northword@users.noreply.github.com> Date: Thu, 8 Aug 2024 20:56:13 +0800 Subject: [PATCH] Fix job skip error --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8c62ad..7a3dd1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest outputs: commit_hash: ${{ steps.check-commit.outputs.short_commit }} - skip_build: ${{ steps.check-commit.outputs.skip_build }} + need_build: ${{ steps.check-commit.outputs.skip_build }} steps: - uses: actions/checkout@v4 with: @@ -37,16 +37,17 @@ jobs: # Check if cached hash exists and matches the latest commit if [[ -f ../last_commit ]] && [[ $(cat ../last_commit) == "$latest_commit" ]]; then echo "No new commits. Skipping build." - echo "skip_build=true" >> $GITHUB_OUTPUT + echo "need_build=false" >> $GITHUB_OUTPUT else echo "$latest_commit" > ./last_commit echo "short_commit=$short_commit" >> $GITHUB_OUTPUT + echo "need_build=true" >> $GITHUB_OUTPUT fi build: needs: - check - if: ${{ needs.check.outputs.skip_build }} + if: ${{ needs.check.outputs.need_build }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -109,7 +110,7 @@ jobs: needs: - check - build - if: ${{ needs.check.outputs.skip_build }} + if: ${{ needs.check.outputs.need_build }} runs-on: ubuntu-latest permissions: contents: write