Re: [PATCH 0/2] replacing ci/config/allow-ref with a repo variable
- From
Jeff King <peff@peff.net>
- Date
- Sep 1, 2023, 17:32 UTC
- Message-ID
- <20230901173214.GA1947546@coredump.intra.peff.net>
- In-Reply-To
- <8624fc43-ab42-442b-a141-851fc35dd24f@gmail.com>
On Fri, Sep 01, 2023 at 02:24:59PM +0100, Phillip Wood wrote:
Show 9 quoted lines
> 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. :)
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?
-Peff