Skip to content

Default mega-linter.yml workflow generated gets tripped up with ActionLinter #3025

Closed
@andrewvaughan

Description

@andrewvaughan

Describe the bug

Results of actionlint linter (version 1.6.26)
See documentation on https://megalinter.io/7.4.0/descriptors/action_actionlint/
-----------------------------------------------

❌ [ERROR] for workspace /tmp/lint
Linter raw log:
.github/workflows/mega-linter.yml:184:13: if: condition "${{ success() }} || ${{ failure() }}" is always evaluated to true because extra characters are around ${{ }} [if-cond]
    |
184 |         if: ${{ success() }} || ${{ failure() }}
    |             ^~~

To Reproduce
Steps to reproduce the behavior:

  1. Run a newly-generated workflow

A clearer way to have this functionality work would be to change the line to:

  if: '!cancelled()'

This makes it clear that the Artifacts should only upload if any action was taken except cancellation. Note that the quotes are necessary so that ! isn't flagged as a YAML tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions