Merge pull request #5944 from dokku/skip-tests
Add the ability to skip ci when commit message includes a ci skip message or are docs related
This commit is contained in:
25
.github/workflows/ci.yml
vendored
25
.github/workflows/ci.yml
vendored
@@ -15,9 +15,34 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
check-commit:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
outputs:
|
||||||
|
skip: ${{ steps.check-commit.outputs.skip }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
|
||||||
|
- name: check if message contain keywords ace scopeid
|
||||||
|
id: check-commit
|
||||||
|
run: |
|
||||||
|
# checking for "docs" or "[ci skip]" messages
|
||||||
|
message=$(git log -1 --pretty=format:'%s')
|
||||||
|
if [[ "$message" =~ "\[(ci skip)\]" ]]; then
|
||||||
|
echo "Skipping tests due to [ci skip] message"
|
||||||
|
echo "skip=true" >> $GITHUB_OUTPUT
|
||||||
|
elif [[ "$message" =~ "^docs:" ]]; then
|
||||||
|
echo "Skipping tests due to "docs:" prefix on message"
|
||||||
|
echo "skip=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: build
|
name: build
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
needs: check-commit
|
||||||
|
if: ${{ needs.check-commit.outputs.skip != 'true' }}
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
Reference in New Issue
Block a user