Closed andrewvaughan closed 1 year ago
This seems to be the most pertinent part of the log, if helpful:
[MegaLinter/MegaLinter] [DEBUG] expression '${{ ! env.ACT }} && ( ${{ success() }} || ${{ failure() }} )' rewritten to 'format('{0} && ( {1} || {2} )', ! env.ACT, success(), failure())'
[MegaLinter/MegaLinter] [DEBUG] evaluating expression 'format('{0} && ( {1} || {2} )', ! env.ACT, success(), failure())'
[MegaLinter/MegaLinter] [DEBUG] expression 'format('{0} && ( {1} || {2} )', ! env.ACT, success(), failure())' evaluated to '%!t(string=false && ( true || false ))'
This seemed to work, but I have not had a chance to test it on GitHub runners yet. Maybe it requires an update to the documentation?
Conditional:
if: ( !env.ACT && ( success() || failure() ) )
Result:
[MegaLinter/MegaLinter] [DEBUG] evaluating expression '( !env.ACT && ( success() || failure() ) )'
[MegaLinter/MegaLinter] [DEBUG] expression '( !env.ACT && ( success() || failure() ) )' evaluated to 'false'
[MegaLinter/MegaLinter] [DEBUG] Skipping step 'Archive production artifacts' due to '( !env.ACT && ( success() || failure() ) )'
I'm aware of this problem, but there are multiple mutable exclusive solutions.
${{ ... }}
surrounded by any chars${{ ... }}
surrounded by any chars to work, but then something will work in act and misbehave after pushIssue is stale and will be closed in 14 days unless there is new activity
@ChristopherHX could you please provide the examples with multiple conditions? I've checked both of the above links and neither of them seem to cover cases with multiple conditions.
Bug report info
Command used with act
Describe issue
I'm attempting to skip a step that is not required and fails when running locally.
It seems that the documented skip method for using the
env.ACT
variable is not working, possibly due to being in-tandem with another conditional. The step is the following (from mega-linter):Regardless, this method always runs. I've been able to confirm that
env.ACT
is equal totrue
on the local platform.Link to GitHub repository
No response
Workflow content
Relevant log output
Additional information
It might be possible that this is a GitHub runner issue? I'm not sure how act is configured below the hood:
https://github.com/actions/runner/issues/1173
That said, please don't write it off as such! This is just for reference. Thank you so much!