File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,6 +57,28 @@ def test_rejects_invalid_hash(self) -> None:
5757 with self .assertRaisesRegex (ValueError , "sha256" ):
5858 load_sources (manifest )
5959
60+ def test_rejects_mutable_raw_github_revision (self ) -> None :
61+ with tempfile .TemporaryDirectory () as directory :
62+ manifest = Path (directory ) / "sources.json"
63+ manifest .write_text (
64+ json .dumps (
65+ {
66+ "sources" : [
67+ {
68+ "name" : "workflow" ,
69+ "url" : "https://raw.githubusercontent.com/example/project/master/workflow.yml" ,
70+ "sha256" : "a" * 64 ,
71+ "destination" : "templates/workflow.yml" ,
72+ }
73+ ]
74+ }
75+ ),
76+ encoding = "utf-8" ,
77+ )
78+
79+ with self .assertRaisesRegex (ValueError , "40-character Git commit SHA" ):
80+ load_sources (manifest )
81+
6082 def test_sync_writes_verified_content (self ) -> None :
6183 content = b"name: Example\n "
6284 source = Source (
You can’t perform that action at this time.
0 commit comments