Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Github allows to do this right away #5

Closed
smnbbrv opened this issue Nov 19, 2019 · 10 comments
Closed

Github allows to do this right away #5

smnbbrv opened this issue Nov 19, 2019 · 10 comments

Comments

@smnbbrv
Copy link

smnbbrv commented Nov 19, 2019

Hi

thanks for your work!

However the current version of github actions allows you to do this in a more elegant way:

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...

@veggiemonk
Copy link
Owner

This is awesome! Thank you @smnbbrv

@ain
Copy link

ain commented Dec 2, 2019

Cool idea, although it comes across as a failure (and throws failure email):

Screenshot 2019-12-02 at 15 20 04

@smnbbrv
Copy link
Author

smnbbrv commented Dec 2, 2019

@MGatner
Copy link

MGatner commented Jan 7, 2020

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
Copy link

ain commented Jan 7, 2020

@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
Copy link

MGatner commented Jan 7, 2020

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
Copy link
Author

smnbbrv commented Jan 7, 2020

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

@MGatner
Copy link

MGatner commented Jan 8, 2020

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:
Screen Shot 2020-01-07 at 9 17 18 PM

The failed action reference:
Screen Shot 2020-01-07 at 9 16 59 PM

The failed email response:
Screen Shot 2020-01-07 at 9 17 45 PM

Notice that the commits correctly lack a check or X, even though Actions records the failures.

@smnbbrv
Copy link
Author

smnbbrv commented Jan 8, 2020

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
Copy link

Looks like it works for me.
if have

runs-on: either linux osx or windows
if: "!contains(github.event.head_commit.message, '[skip ci]')"

logs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants