On 05/09/2023 08:24, Jeff King wrote:
On Mon, Sep 04, 2023 at 10:56:15AM +0100, Phillip Wood wrote:
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.
It does make it easier. There's no globbing function available to us,
but if we know something is a prefix, there's a startsWith() we can use.
It does seem we're getting a combinatorial expansion of things to check,
though:
- full names to accept
- full names to reject
- prefixes to accept
- prefixes to reject
I wrote "prefixes" but I'm actually not sure how feasible that is. That
implies iterating over the list of prefixes, which I'm not sure we can
do.
I scanned the github documentation the other day and wondered if it
would be possible to use with fromJson with a json array to do a prefx
match on each element. It all sounds like it is getting a bit
complicated though.
Best Wishes
Phillip
-Peff