Skip to content

Commit 99bb0f0

Browse files
Use if then else
Apply code review suggestion. Co-Authored-By: Taus <[email protected]>
1 parent cf8abb7 commit 99bb0f0

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,7 @@ where
4141
uses.getVersion() = version and
4242
not isTrustedOwner(nwo) and
4343
not isImmutableAction(uses, nwo) and
44-
not
45-
(
46-
(
47-
isContainerImage(nwo) and
48-
isPinnedContainer(version)
49-
)
50-
or
51-
(
52-
not isContainerImage(nwo) and
53-
isPinnedCommit(version)
54-
)
55-
)
44+
not if isContainerImage(nwo) then isPinnedContainer(version) else isPinnedCommit(version)
5645
select uses.getCalleeNode(),
5746
"Unpinned 3rd party Action '" + name + "' step $@ uses '" + nwo + "' with ref '" + version +
5847
"', not a pinned commit hash", uses, uses.toString()

0 commit comments

Comments
 (0)