Skip to content

Commit df06207

Browse files
Merge pull request #2541 from vamshi-stepsecurity/feat/pin-using-action-commit-map
update value field in Action Commit map
2 parents 28b4579 + 3d500ae commit df06207

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

remediation/workflow/pin/pinactions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func PinAction(action, inputYaml string, exemptedActions []string, pinToImmutabl
7676
// Check case-insensitively by iterating through the map
7777
for mapAction, actionWithCommit := range actionCommitMap {
7878
if strings.EqualFold(action, mapAction) && actionWithCommit != "" {
79-
commitSHA = strings.Split(actionWithCommit, "@")[1]
79+
commitSHA = actionWithCommit
8080

8181
if !semanticTagRegex.MatchString(tagOrBranch) {
8282
tagOrBranch, err = getSemanticVersion(client, owner, repo, tagOrBranch, commitSHA)

remediation/workflow/pin/pinactions_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ func TestPinActions(t *testing.T) {
328328

329329
if tt.fileName == "pinusingmap.yml" {
330330
actionCommitMap = map[string]string{
331-
"peter-evans-test/close-issue@v1": "peter-evans-test/close-issue@a700eac5bf2a1c7a8cb6da0c13f93ed96fd53vam",
332-
"peter-check/[email protected]": "peter-check/close-issue@a700eac5bf2a1c7a8cb6da0c13f93ed96fd53tom",
331+
"peter-evans-test/close-issue@v1": "a700eac5bf2a1c7a8cb6da0c13f93ed96fd53vam",
332+
"peter-check/[email protected]": "a700eac5bf2a1c7a8cb6da0c13f93ed96fd53tom",
333333
}
334334
}
335335

0 commit comments

Comments
 (0)