@@ -33,6 +33,21 @@ func TestPinActions(t *testing.T) {
3333 }
3434 ]` ))
3535
36+ httpmock .RegisterResponder ("GET" , "https://api.github.com/repos/evans/shield/commits/v1" ,
37+ httpmock .NewStringResponder (200 , `a700eac5bf2a1c7a8cb6da0c13f93ed96fd53dbd` ))
38+
39+ httpmock .RegisterResponder ("GET" , "https://api.github.com/repos/evans/shield/git/matching-refs/tags/v1." ,
40+ httpmock .NewStringResponder (200 ,
41+ `[
42+ {
43+ "ref": "refs/tags/v1.0.3",
44+ "object": {
45+ "sha": "a700eac5bf2a1c7a8cb6da0c13f93ed96fd53dbd",
46+ "type": "commit"
47+ }
48+ }
49+ ]` ))
50+
3651 httpmock .RegisterResponder ("GET" , "https://api.github.com/repos/actions/checkout/commits/master" ,
3752 httpmock .NewStringResponder (200 , `61b9e3751b92087fd0b06925ba6dd6314e06f089` ))
3853
@@ -308,7 +323,7 @@ func TestPinActions(t *testing.T) {
308323 {fileName : "actionwithcomment.yml" , wantUpdated : true , pinToImmutable : true },
309324 {fileName : "repeatedactionwithcomment.yml" , wantUpdated : true , pinToImmutable : true },
310325 {fileName : "immutableaction-1.yml" , wantUpdated : true , pinToImmutable : true },
311- {fileName : "exemptaction.yml" , wantUpdated : true , exemptedActions : []string {"actions/checkout" , "rohith/*" , "praveen/*" , "aman-*/*" , "*/seperate*" }, pinToImmutable : true },
326+ {fileName : "exemptaction.yml" , wantUpdated : true , exemptedActions : []string {"actions/checkout" , "rohith/*" , "praveen/*" , "aman-*/*" , "*/seperate*" , "starc/*" }, pinToImmutable : true },
312327 {fileName : "donotpintoimmutable.yml" , wantUpdated : true , pinToImmutable : false },
313328 {fileName : "invertedcommas.yml" , wantUpdated : true , pinToImmutable : false },
314329 {fileName : "pinusingmap.yml" , wantUpdated : true , pinToImmutable : true },
@@ -330,6 +345,7 @@ func TestPinActions(t *testing.T) {
330345 actionCommitMap = map [string ]string {
331346 "peter-evans-test/close-issue@v1" : "a700eac5bf2a1c7a8cb6da0c13f93ed96fd53vam" ,
332347 "peter-check/[email protected] " :
"a700eac5bf2a1c7a8cb6da0c13f93ed96fd53tom" ,
348+ "evans/shield-test/@v1.2.5" : "a700eac5bf2a1c7a8cb6da0c13f93ed96fd53cat" ,
333349 }
334350 }
335351
0 commit comments