Skip to content

Commit

Permalink
Use if then else
Browse files Browse the repository at this point in the history
Apply code review suggestion.

Co-Authored-By: Taus <[email protected]>
  • Loading branch information
martincostello and tausbn committed Feb 14, 2025
1 parent cf8abb7 commit 99bb0f0
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,7 @@ where
uses.getVersion() = version and
not isTrustedOwner(nwo) and
not isImmutableAction(uses, nwo) and
not
(
(
isContainerImage(nwo) and
isPinnedContainer(version)
)
or
(
not isContainerImage(nwo) and
isPinnedCommit(version)
)
)
not if isContainerImage(nwo) then isPinnedContainer(version) else isPinnedCommit(version)
select uses.getCalleeNode(),
"Unpinned 3rd party Action '" + name + "' step $@ uses '" + nwo + "' with ref '" + version +
"', not a pinned commit hash", uses, uses.toString()

0 comments on commit 99bb0f0

Please sign in to comment.