Re: [PATCH] ci: avoid unnecessary builds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 09, 2022 at 09:00:33AM -0500, Jeff King wrote:
> On Tue, Nov 08, 2022 at 10:16:15AM +0100, Johannes Schindelin wrote:
>
> > > As an aside, I wish there was a way to interpret per-repo environment
> > > variables in the actual action config.
> >
> > There kind of is. "Kind of" because it is not _really_ a per-repo variable
> > (those do not exist on GitHub), but there are topics you can set. These
> > are relatively free-form labels you can attach to _your_ fork, and these
> > labels show up below the "About" section and the link to the home page (if
> > any) on the right side of your respository. AFAICT these topics are not
> > inherited automatically when forking a repository, which is precisely what
> > we want. See
> > https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics
> > for more details on that.
>
> Ah, that's very clever, thank you!

Very cute.

> For the original problem that motivated me adding ci-config in the first
> place, branch selection, I think we could do this:
>
>   if: |
>     !contains(join(github.event.repository.topics), 'ci-only-') ||
>     contains(github.event.repository.topics, format('ci-only-{0}', github.ref_name))
>
> and then by default we'd continue to build for all pushes, but if you
> add ci-only-foo as a repo topic, then we'd build only refs/heads/foo.
>
> I may see if I can work this into our workflow file. Even if we can't
> get rid of ci-config for the skip-successful-build feature, this would
> still save CPU by dropping even ci-config when the branch should be
> skipped entirely.

Yeah. I'd be hesitant to see a bunch of CI configuration knobs get
folded into the repository topics feature, but a clear "save CI minutes
if we don't care about building these branch(es)" is useful.

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux