~sircmpwn/sr.ht-discuss

3 3

Skip CI for readme changes

Details
Message ID
<7b60bc16130cbe1980fc1470b1ea6da7@cartitas.com>
DKIM signature
missing
Download raw message
Hello, I was wondering if there was a way to skip CI runs for commits that only
change text files.

For example, I have this .build.yml file at the root of my repo.

image: alpine/edge
packages:
  - go
sources:
  - https://git.sr.ht/~ixoh/foo
tasks:
  - test: cd foo && make test

Then I tweaked my readme and pushed the change. A whole CI run kicked off.

Anyway to avoid this?
Details
Message ID
<CS0HUPB1896H.3BVIU8QGCR8MO@navi>
In-Reply-To
<7b60bc16130cbe1980fc1470b1ea6da7@cartitas.com> (view parent)
DKIM signature
missing
Download raw message
On Wed Apr 19, 2023 at 7:37 AM CEST,  wrote:
> Hello, I was wondering if there was a way to skip CI runs for commits that only
> change text files.
As far as I'm aware this is not possible, but you can manually choose to skip a
CI run when you push your commits with `git push -o skip-ci`:
https://man.sr.ht/builds.sr.ht/#gitsrht

-- 
witcher
Details
Message ID
<sj7hklkd5yo5fu4sawfgetdvi6w4hrkvv6wvsd3kwszwsvsztn@ushwjk4lq444>
In-Reply-To
<7b60bc16130cbe1980fc1470b1ea6da7@cartitas.com> (view parent)
DKIM signature
missing
Download raw message
On 23-04-19 05:37:59, ixoh@cartitas.com wrote:
> Hello, I was wondering if there was a way to skip CI runs for commits that only
> change text files.
> 

My suggestion is to implement a small check that completes the CI
pipeline if the change is only in the README (or any other files you
want to skip). Make can probably be used for this, but here's an
example that uses the file list shown as modified in the git HEAD.

Eg:

tasks:
  - check: test -n "$(git show HEAD --name-only --oneline --format= | grep README.md)" && complete-build

Cheers,
/Marius
Details
Message ID
<6f5e6d0c63fee4f13cc5f19c39ce80e6@cartitas.com>
In-Reply-To
<sj7hklkd5yo5fu4sawfgetdvi6w4hrkvv6wvsd3kwszwsvsztn@ushwjk4lq444> (view parent)
DKIM signature
missing
Download raw message
> you can manually choose to skip a CI run when you push your commits with `git
> push -o skip-ci`: https://man.sr.ht/builds.sr.ht/#gitsrht

Thanks for the link. I totally missed that! Just gotta remember to use that
when I push text changes.

> My suggestion is to implement a small check that completes the CI pipeline if
> the change is only in the README (or any other files you want to skip).

Oooh, also interesting. Ideally, I wouldn't have to start a whole CI run. I
feel kinda bad taking up resources just for a no-op. When I focus on
documentation, I tend to do a lot of small pushes with just text changes.

Anyway, thanks for the two approaches!
Reply to thread Export thread (mbox)