Skip to content

Commit e29c2f4

Browse files
authored
Now GH actions support skip ci officially (#4579)
ref: https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/ Signed-off-by: Outsider <outsideris@gmail.com>
1 parent 8d6d1e3 commit e29c2f4

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

.github/workflows/mocha.yml

+4-25
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,16 @@ name: Tests
88
- reopened
99

1010
jobs:
11-
prepare-commit-msg:
12-
name: Retrieve head commit message
11+
prevent-run-twice:
12+
name: Prevent to run twice
1313
runs-on: ubuntu-latest
1414
# Run 'pull-request' event only on external PRs from forked repos.
1515
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
16-
outputs:
17-
HEAD_COMMIT_MSG: '${{ steps.commitMsg.outputs.HEAD_COMMIT_MSG }}'
1816
steps:
19-
- uses: actions/checkout@v2
20-
if: github.event_name == 'pull_request'
21-
- name: find commit msg for PR
22-
id: commitMsg
23-
if: github.event_name == 'pull_request'
24-
run: >-
25-
echo "::set-output name=HEAD_COMMIT_MSG::$(git log --no-merges -1
26-
--oneline)"
27-
28-
check-skip:
29-
name: Check to skip CI
30-
needs: prepare-commit-msg
31-
runs-on: ubuntu-latest
32-
if: >-
33-
${{ !contains(github.event.head_commit.message, '[ci skip]') &&
34-
!contains(needs.prepare-commit-msg.outputs.HEAD_COMMIT_MSG, '[ci skip]')
35-
}}
36-
steps:
37-
- run: 'echo "${{ github.event.head_commit.message }}"'
38-
17+
- run: 'echo run Tests'
3918
smoke:
4019
name: 'Smoke [Node.js v${{ matrix.node }} / ${{ matrix.os }}]'
41-
needs: check-skip
20+
needs: prevent-run-twice
4221
runs-on: '${{ matrix.os }}'
4322
strategy:
4423
matrix:

0 commit comments

Comments
 (0)