Skip to content

Commit

Permalink
Revert "Special-case FROM scratch when detecting the latest tag" (#166)
Browse files Browse the repository at this point in the history
This reverts commit e91880e.
  • Loading branch information
JAORMX authored Oct 2, 2024
1 parent 48c9cb9 commit 9ae11d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rule-types/github/dockerfile_no_latest_tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def:
dockerfile := file.read("Dockerfile")
# Find all lines that start with FROM and have the latest tag
from_lines := regex.find_n("(?m)^(FROM .*:latest|FROM --platform=[^ ]+ [^: ]+|FROM (?!scratch$)[^: ]+)( (as|AS) [^ ]+)?$", dockerfile, -1)
from_lines := regex.find_n("(?m)^(FROM .*:latest|FROM --platform=[^ ]+ [^: ]+|FROM [^: ]+)( (as|AS) [^ ]+)?$", dockerfile, -1)
from_line := from_lines[_]
msg := sprintf("Dockerfile contains 'latest' tag in import: %s", [from_line])
Expand Down

0 comments on commit 9ae11d9

Please sign in to comment.