Re: [PATCH] ci: avoid unnecessary builds
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Nov 8, 2022, 18:30 UTC
- Message-ID
- <Y2qgPKRW1+9BNkIp@nand.local>
- In-Reply-To
- <75ono097-16nr-nno4-rqoq-rrn79spps249@tzk.qr>
On Tue, Nov 08, 2022 at 09:18:21AM +0100, Johannes Schindelin wrote:
Show 9 quoted lines
> > I played around with the following, but I can't quite get Actions to > > like it. The error message I get (ref[1]) is something like: > > > > The workflow is not valid. .github/workflows/main.yml (Line: 96, Col: > > 27): Unexpected value 'needs.ci-config.outputs.skip_concurrent == 'yes'' > > .github/workflows/main.yml (Line: 123, Col: 27): Unexpected value > > 'needs.ci-config.outputs.skip_concurrent == 'yes'' > > The reason is that what you are trying to do simply cannot work.
I was surprised that I couldn't get this to work, because to me it seemed like the sort of thing that *should* be possible to do.
Indeed, it is, and I made a couple of mistakes in writing the workflow file:
- The expression for 'skip-in-progress' needed to be enclosed in
'${{}}' markers. - It also needed to take into account the job name (and matrix
information!) where relevant. And here we can't just use
${{github.job}}, since that is only available inside of the job
steps.To the last bullet point there, we unfortunately have to copy and paste the job name, which seems like a limitation of the Actions workflow parser to me.
I posted an alternative approach to this patch in [1], and I would be very curious to hear your thoughts, if you have time!
Thanks, Taylor
[1]: https://lore.kernel.org/git/cover.1667931937.git.me@ttaylorr.com/T/#t