Skip to content

Commit

Permalink
Fix: Removed curly-brackets from if (closes #3025) (#3029)
Browse files Browse the repository at this point in the history
* Fix: Removed curly-brackets from if (closes #3025)

A mix of linters fail here, starting with actionlint throwing an
(incorrect) "... is always evaluated to true because extra characters
are around ${{ }}". I believe this is accidentally assuming the
entire statement is curly-bracket wrapped, which it isn't.

Regardless, curly brackets are not required for `if` statements in
the YAML, and can be removed. A best-practice approach would be
changing this to the newer '!cancelled()' flag, which does the same
thing, but this will throw errors when Prettier ultimately changes
the single-quotes to double-quotes and breaks the statement.

As such, the best course of action is to simply remove the curly-
brackets from the existing statement to satisfy Checkov and prevent
linting errors in the default-generated file.

* Added changelog entry

---------

Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
  • Loading branch information
andrewvaughan and echoix authored Oct 21, 2023
1 parent 667f6c9 commit 22b6789
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Fixes
- build.py: Remove exclusivity between pip, gem & cargo packages
- Salesforce linters: Switch sfdx-cli to @salesforce/cli
- Fixed issue with `actionlint` throwing an error on `if` statements in the generated workflow file
- Added default `.devskim.json` to mitigate errors introduced when no config exists

- Doc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
# Upload MegaLinter artifacts
- name: Archive production artifacts
uses: actions/upload-artifact@v3
if: ${{ success() }} || ${{ failure() }}
if: success() || failure()
with:
name: MegaLinter reports
path: |
Expand Down

0 comments on commit 22b6789

Please sign in to comment.