From ea8a44b36ca4c047527240454661ba30f99f57a3 Mon Sep 17 00:00:00 2001 From: Kin Fei Lee Date: Sat, 23 Dec 2023 20:25:59 +0800 Subject: [PATCH] ci: change to use save-state --- .github/workflows/pipeline.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index d239237..eaaa60e 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -19,10 +19,10 @@ jobs: run: | if [ "${{ github.event_name }}" == 'push' ] && [ "${{ github.repository }}" != "${{ github.actor }}/express-api-template" ]; then echo "Stopping job because it's a repository creation event." - echo "::set-output name=result::failure" + echo "::save-state name=result::failure" else echo "Proceeding with the job." - echo "::set-output name=result::success" + echo "::save-state name=result::success" fi - name: Checkout code and Use Node.js @@ -34,6 +34,15 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - run: yarn install - - run: yarn lint - - run: yarn test:coverage + + - name: Install dependencies + if: ${{ needs.build.outputs.result == 'success' }} + run: yarn install + + - name: Lint + if: ${{ needs.build.outputs.result == 'success' }} + run: yarn lint + + - name: Test and Coverage + if: ${{ needs.build.outputs.result == 'success' }} + run: yarn test:coverage