Replies: 6 comments 3 replies
-
@su-sisk - could you try it with the curly braces , like |
Beta Was this translation helpful? Give feedback.
-
Does anyone know why the matrix context is not available for |
Beta Was this translation helpful? Give feedback.
-
@fherreazcue the workaround (forgive me if this is obvious) is to pass your flag as an input in the called workflow and then it will be in an accessible context for the jobs (and there if condition) defined there. @su-sisk, agree this is super annoying; you'd think after so many years (and plugins) after Jenkins, the semantic difference between aborted/skipped vs. failed vs. cancelled would be clear. The reliance on exit-codes is unnecessarily unsophisticated i.e 0-zero for success and everything else is a fail; unless with the 0-zero magic number we add non-zero magic numbers to trigger/reflect the various job outcomes/conclusions... But from a Bash step-run context, functions are an obvious way forward:
|
Beta Was this translation helpful? Give feedback.
-
It's not obvious to me. Could you provide an example of how the OP's workflow could be modified to implement your suggestion? |
Beta Was this translation helpful? Give feedback.
-
Not sure if I should open another discussion to request a new feature where matrix can be extended to become available in an However, because of the information described here: This means that the job will not report it's status properly at all. If I could instead add a special boolean to the matrix json format I am using and simply check ContextYou can check out my draft PR for context here: This system uses the Nix package manager as a base package builder for CI. Nix is a highly reproducible build system using formal methods to ensure that if inputs do not change, the build result should be the same. In CI, this means that if a given job is simply building a package, we can just skip it entirely if it has already been built in a previous round and its input hash has not changed. This presents a problem when status checks are required on certain builds however. |
Beta Was this translation helpful? Give feedback.
-
So, this is still an issue. I also have similar requirement where i need to access matrix properties under jobs.job.if but it throws the same error. no fix has been done yet its 2025! |
Beta Was this translation helpful? Give feedback.
-
Hi guys 🤠
I'm wondering if it's possible to use the matrix context in a
jobs.job.if
to control the execution ?The docs states that we can use any context and expression to create conditionals.
Sry if this is a stupid question, an example of my problem is shown below
Example
Running this gives the following error:
The workflow is not valid. .github/workflows/matrix-example.yml (Line: 27, Col: 9): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.packages.enabled == 'true'
All i really wanna achive is to be able to "skip and mark job as skipped" So I could add a initial step to my job that checks this using bash script, but if that exits with 0 or 1 the job is marked as failed or success. Is it possible to mark the job as "skipped"? e.g through something like this?
echo "::job-status='skipped' "
Beta Was this translation helpful? Give feedback.
All reactions