Use if then else

Apply code review suggestion.

Co-Authored-By: Taus <1104778+tausbn@users.noreply.github.com>
This commit is contained in:
martincostello
2025-02-14 13:30:55 +00:00
parent cf8abb7989
commit 99bb0f0b4f

View File

@@ -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()