git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] replacing ci/config/allow-ref with a repo variable

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Sep 7, 2023, 10:04 UTC
Message-ID
<fcdc682b-cf6c-4db9-9970-be136f48de58@gmail.com>
In-Reply-To
<20230905072444.GH199565@coredump.intra.peff.net>
On 05/09/2023 08:24, Jeff King wrote:
Show 26 quoted lines
> 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
Previous: Jeff KingNext: Jeff King
Message 13 of 18 in “replacing ci/config/allow-ref with a repo variable”
  1. 0/2 replacing ci/config/allow-ref with a repo variableJeff King, Aug 30, 2023
  2. 1/2 ci: allow branch selection through "vars"Jeff King, Aug 30, 2023
  3. Johannes SchindelinSep 3, 2023
  4. Jeff KingSep 5, 2023
  5. Johannes SchindelinSep 5, 2023
  6. Jeff KingSep 7, 2023
  7. 2/2 ci: deprecate ci/config/allow-ref scriptJeff King, Aug 30, 2023
  8. Junio C HamanoAug 30, 2023
  9. Phillip WoodSep 1, 2023
  10. Jeff KingSep 1, 2023
  11. Phillip WoodSep 4, 2023
  12. Jeff KingSep 5, 2023
  13. Phillip WoodSep 7, 2023
  14. Jeff KingSep 11, 2023
  15. Phillip WoodSep 13, 2023
  16. Jeff KingSep 14, 2023
  17. Jeff KingSep 14, 2023
  18. Phillip WoodSep 14, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.