followup #17561, skipping ci now implies green (#17813)

* followup #17561, skip ci now implies green; [skip ci]
* fixup [skip ci]
* fixup test without skip ci
* fixup [skip ci]
* fixup2 [skip ci]
* github actions now automatically supports [skip ci]
This commit is contained in:
Timothee Cour 2021-04-23 01:05:23 -07:00 • committed by GitHub
commit dbb053492a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 33 deletions

View file

@ -1,4 +1,5 @@
# utilities used in CI pipelines to avoid duplication.
# Avoid top-level statements.
echo_run () {
# echo's a command before running it, which helps understanding logs
@ -6,3 +7,24 @@ echo_run () {
echo "$@"
"$@"
}
nimGetLastCommit() {
git log --no-merges -1 --pretty=format:"%s"
}
nimIsCiSkip(){
# D20210329T004830:here refs https://github.com/microsoft/azure-pipelines-agent/issues/2944
# `--no-merges` is needed to avoid merge commits which occur for PR's.
# $(Build.SourceVersionMessage) is not helpful
# nor is `github.event.head_commit.message` for github actions.
# Note: `[skip ci]` is now handled automatically for github actions, see https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/
commitMsg=$(nimGetLastCommit)
echo commitMsg: "$commitMsg"
if [[ $commitMsg == *"[skip ci]"* ]]; then
echo "skipci: true"
return 0
else
echo "skipci: false"
return 1
fi
}