From 054934e8babad738aa3639a83f73293f596fa459 Mon Sep 17 00:00:00 2001 From: Sped0n Date: Sat, 4 Nov 2023 18:47:39 +0800 Subject: [PATCH] feat(artifacts.yml): add output variable 'result' to the filter job to indicate if any files in the scope have changed --- .github/workflows/artifacts.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 367daf6..33e569d 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -9,7 +9,8 @@ jobs: filter: runs-on: ubuntu-latest name: Filter - continue-on-error: true + outputs: + result: ${{ steps.changed-files-specific.outputs.any_changed }} steps: - uses: actions/checkout@v3 with: @@ -23,14 +24,6 @@ jobs: package.json assets/** - - name: Run step if any file(s) in the scope change - if: steps.changed-files-specific.outputs.any_changed == 'true' - run: echo "{result}={false}" >> $GITHUB_OUTPUT - - - name: Prevent from running - if: steps.changed-files-specific.outputs.any_changed != 'true' - run: echo "{result}={false}" >> $GITHUB_OUTPUT - build: timeout-minutes: 30 runs-on: ubuntu-latest @@ -39,7 +32,7 @@ jobs: if: | github.ref == 'refs/heads/main' && github.event.repository.fork == 'false' && - needs.filter.result == 'true' + needs.filter.outputs.result == 'true' steps: - name: Checkout uses: actions/checkout@v3