Github allows to do this right away

#5 · closed · 10 comments

View on GitHub ↗

smnbbrv

Hi thanks for your work! However the current version of github actions allows you to do this in a more elegant way: ```yml jobs: main: name: Build and test runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" ``` Probably worth mentioning it in the readme...

Comments

veggiemonk

This is awesome! Thank you @smnbbrv

ain

Cool idea, although it comes across as a failure (and throws failure email): ![Screenshot 2019-12-02 at 15 20 04](https://user-images.githubusercontent.com/370576/69966738-4a1bfa00-1517-11ea-8ff2-53ddb262f3cc.png)

smnbbrv

Does not for me... See https://github.com/ngx-grpc/protoc-gen-ng/commits/master ![image](https://user-images.githubusercontent.com/13453858/69968932-bef13300-151b-11ea-88d9-3b8c8af639d2.png)

MGatner

I'm baffled how @smnbbrv got this to work without failures. Every time I use `ci skip` it instantly generates a failure and corresponding email. EDIT: Actually it appears this is a bug with an active ticket: https://github.community/t5/GitHub-Actions/Status-of-workflows-with-no-running-jobs/td-p/37160

ain

@MGatner of course the discussion there has no binding to this particular repo. It clearly fails and I can't imagine the circumstances of how this could succeed. The discussion you linked to proves this assumption true.

MGatner

If I understand correctly the report and subsequent response, workflows that run now jobs should count as "skipped", but currently count incorrectly as failures. I'm hopeful that when this issue is resolved this method of providing `ci skip` functionality will be viable and work consistent with other pipelines.

smnbbrv

Could you post some failure examples? For me it works like a charm again and again

MGatner

Unfortunately all mine are on private repos right now, but they are definitely happening. Here's the relevant portion of my workflow: ``` name: PHP Unit Tests on: push: branches: - develop jobs: main: name: Build and test strategy: matrix: php-versions: ['7.2', '7.3', '7.4'] runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" ``` The commit with matching text: <img width="945" alt="Screen Shot 2020-01-07 at 9 17 18 PM" src="https://user-images.githubusercontent.com/17572847/71945017-964fff00-3193-11ea-9445-2f107bf6fb2b.png"> The failed action reference: <img width="1126" alt="Screen Shot 2020-01-07 at 9 16 59 PM" src="https://user-images.githubusercontent.com/17572847/71945015-964fff00-3193-11ea-8980-bf9089c7cd0b.png"> The failed email response: <img width="830" alt="Screen Shot 2020-01-07 at 9 17 45 PM" src="https://user-images.githubusercontent.com/17572847/71945016-964fff00-3193-11ea-80c4-60731cacf0c2.png"> Notice that the commits correctly lack a check or X, even though Actions records the failures.

smnbbrv

What’s really different to my builds here is matrix. My reasons for ci skip are coming from a semantic release CHANGELOG.md commit - I don’t want it to trigger another release = avoid infinite loop. Maybe the matrix build is the key to the problem here...

fennecdjay

Looks like it works for me. if have ``` yml runs-on: either linux osx or windows if: "!contains(github.event.head_commit.message, '[skip ci]')" ``` [logs](https://github.com/fennecdjay/Gwion/actions)