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
Jeff King <peff@peff.net>
Date
Sep 14, 2023, 00:44 UTC
Message-ID
<20230914004406.GA2224848@coredump.intra.peff.net>
In-Reply-To
<20230914003010.GA1709842@coredump.intra.peff.net>
Two minor corrections in what I wrote...
On Wed, Sep 13, 2023 at 08:30:10PM -0400, Jeff King wrote:
Show 6 quoted lines
> (BTW, one other thing I tried was using fromJSON(vars.CI_CONFIG) in the
> "on" expression, which in theory would allow globbing. But it doesn't
> look like expressions work at all in that context. And even if they did,
> I'm not sure we could make it work such that an empty CI_CONFIG used
> some defaults, since there's no conditional-expression ternary
> operator).

It's not a real ?: operator, but GitHub does use the word "ternary" to describe the short-circuit behavior of:

  condition && "if-true" || "if-not-true"
So in theory we could do:
  on: ${{ fromJSON(var.CI_ON != '' && vars.CI_ON || "[pull_request, push]" }}

but I couldn't make it work (it complains about the value of "on" in such a way that I assume it is simply not expanding expressions at all).

Show 7 quoted lines
> We have the necessary bits at the protocol: push-options. But it's up to
> the server-side hooks to decide which ones are meaningful and to do
> something useful with them. It looks like GitLab supports:
> 
>   git push -o ci.skip=1 ...
> 
> but I don't think GitHub respects any equivalent option.

The syntax here is actually just "git push -o ci.skip", without the equals.

-Peff
Previous: Jeff KingNext: Phillip Wood
Message 17 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.