From: Phillip Wood Date: Mon, 04 Sep 2023 09:56:15 GMT Subject: Re: [PATCH 0/2] replacing ci/config/allow-ref with a repo variable Message-ID: In-Reply-To: <20230901173214.GA1947546@coredump.intra.peff.net> On 01/09/2023 18:32, Jeff King wrote: > On Fri, Sep 01, 2023 at 02:24:59PM +0100, Phillip Wood wrote: > >> On 30/08/2023 20:49, Jeff King wrote: >>> This is a more efficient way to do the same thing that >>> ci/config/allow-ref does (which didn't exist back then). >> >> I like the idea of a more efficient way to skip the ci for certain refs. >> I've got my allow-ref script set up to reject a bunch of refs and run the ci >> on everything else. It's not clear to me how to replicate that with the >> setup proposed here. Would it be possible to add a second variable that >> prevents the ci from being run if it contains ref being pushed? > > Drat, I was hoping nobody was using it that way. :) Sorry to be a pain. > Yes, I think it would be possible to do something like: > > if: | > (vars.CI_BRANCHES == '' || contains(vars.CI_BRANCHES, github.ref_name)) && > !contains(vars.CI_BRANCHES_REJECT, github.ref_name) > > It doesn't allow globbing, though. Do you need that? Oh I'd missed that, yes I do. All the globs are prefix matches but I'm not sure that helps. Best Wishes Phillip > -Peff