From 8112d9e5c3e6e84501b855eec5f1f13da92838ae Mon Sep 17 00:00:00 2001 From: Outsider Date: Sat, 20 Feb 2021 14:52:54 +0900 Subject: [PATCH] Now GH actions support skip ci officially ref: https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/ Signed-off-by: Outsider --- .github/workflows/mocha.yml | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/mocha.yml b/.github/workflows/mocha.yml index 4e65c6b8f0..745cb4b13c 100644 --- a/.github/workflows/mocha.yml +++ b/.github/workflows/mocha.yml @@ -8,37 +8,16 @@ name: Tests - reopened jobs: - prepare-commit-msg: - name: Retrieve head commit message + prevent-run-twice: + name: Prevent to run twice runs-on: ubuntu-latest # Run 'pull-request' event only on external PRs from forked repos. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository - outputs: - HEAD_COMMIT_MSG: '${{ steps.commitMsg.outputs.HEAD_COMMIT_MSG }}' steps: - - uses: actions/checkout@v2 - if: github.event_name == 'pull_request' - - name: find commit msg for PR - id: commitMsg - if: github.event_name == 'pull_request' - run: >- - echo "::set-output name=HEAD_COMMIT_MSG::$(git log --no-merges -1 - --oneline)" - - check-skip: - name: Check to skip CI - needs: prepare-commit-msg - runs-on: ubuntu-latest - if: >- - ${{ !contains(github.event.head_commit.message, '[ci skip]') && - !contains(needs.prepare-commit-msg.outputs.HEAD_COMMIT_MSG, '[ci skip]') - }} - steps: - - run: 'echo "${{ github.event.head_commit.message }}"' - + - run: 'echo run Tests' smoke: name: 'Smoke [Node.js v${{ matrix.node }} / ${{ matrix.os }}]' - needs: check-skip + needs: prevent-run-twice runs-on: '${{ matrix.os }}' strategy: matrix: