TWiStErRob / net.twisterrob.ghlint

https://ghlint.twisterrob.net/
5 stars 0 forks source link

DoubleCurlyIf false positive on multiline expressions #222

Open TWiStErRob opened 3 weeks ago

TWiStErRob commented 3 weeks ago

Version

ghlint 0.5.0

Reproduction steps

Run ghlint on:

   if: >
     ${{
       github.event_name == 'workflow_dispatch' || 
       github.event_name == 'workflow_call' ||
       (github.event_name == 'pull_request' && github.event.pull_request.draft == false && github.event.pull_request.merged == true)
     }}

Expected behavior

Pass

Actual behavior

if: is not wrapped in double-curly-braces.

Additional Context

No response

TWiStErRob commented 2 weeks ago

consider also

      if: ${{
    github.event_name == 'workflow_dispatch' || 
    github.event_name == 'workflow_call' ||
    (github.event_name == 'pull_request' && github.event.pull_request.draft == false && github.event.pull_request.merged == true)
  }}

I originally had if: > and then what you suggest - but that was resolving to true when it should be false. Which led me to this discussion: https://github.com/orgs/community/discussions/25641

see also "plain" at https://yaml-multiline.info/