From bcc67d1d6329eeeab90a81cdd543c20a65eb2371 Mon Sep 17 00:00:00 2001 From: Kin Fei Lee Date: Sat, 23 Dec 2023 20:30:33 +0800 Subject: [PATCH] ci: change to use $github_state --- .github/workflows/pipeline.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index eaaa60e..450656d 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -10,39 +10,36 @@ jobs: matrix: node-version: [18.x] - outputs: - result: ${{ steps.set-status.outputs.result }} - steps: - name: Check if it's a repository creation event id: set-status 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 "::save-state name=result::failure" + echo "skip_ci=true" >> $GITHUB_STATE else echo "Proceeding with the job." - echo "::save-state name=result::success" + echo "skip_ci=false" >> $GITHUB_STATE fi - name: Checkout code and Use Node.js - if: ${{ needs.build.outputs.result == 'success' }} + if: ${{ skip_ci == 'false' }} uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - if: ${{ needs.build.outputs.result == 'success' }} + if: ${{ skip_ci == 'false' }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install dependencies - if: ${{ needs.build.outputs.result == 'success' }} + if: ${{ skip_ci == 'false' }} run: yarn install - name: Lint - if: ${{ needs.build.outputs.result == 'success' }} + if: ${{ skip_ci == 'false' }} run: yarn lint - name: Test and Coverage - if: ${{ needs.build.outputs.result == 'success' }} + if: ${{ skip_ci == 'false' }} run: yarn test:coverage