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?
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
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
> 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!