Skip to content

Commit eadfcec

Browse files
committed
Revert "Fix sentence and remove existing action comments (#2067)"
This reverts commit 830739d.
1 parent 830739d commit eadfcec

File tree

16 files changed

+13
-79
lines changed

16 files changed

+13
-79
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Harden Runner
4444
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5
4545
with:
46-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
46+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
4747

4848
- name: Checkout repository
4949
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

.github/workflows/kbanalysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Harden Runner
2525
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5
2626
with:
27-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
27+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
2828

2929
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28
3030
with:

remediation/workflow/hardenrunner/addaction.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func addAction(inputYaml, jobName, action string) (string, error) {
8383
output = append(output, spaces+fmt.Sprintf("- name: %s", HardenRunnerActionName))
8484
output = append(output, spaces+fmt.Sprintf(" uses: %s", action))
8585
output = append(output, spaces+" with:")
86-
output = append(output, spaces+" egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs")
86+
output = append(output, spaces+" egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs")
8787
output = append(output, "")
8888

8989
for i := jobNode.Line - 1; i < len(inputLines); i++ {

remediation/workflow/pin/pinactions.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ func PinAction(action, inputYaml string) (string, bool) {
7676
pinnedAction := fmt.Sprintf("%s@%s # %s", leftOfAt[0], commitSHA, tagOrBranch)
7777
updated = !strings.EqualFold(action, pinnedAction)
7878
inputYaml = strings.ReplaceAll(inputYaml, action, pinnedAction)
79-
stringParts := strings.SplitN(inputYaml, pinnedAction, 2)
80-
if len(stringParts) > 1 {
81-
trimmedString := strings.SplitN(stringParts[1], "\n", 2)
82-
if len(trimmedString) > 1 {
83-
inputYaml = stringParts[0] + pinnedAction + "\n" + trimmedString[1]
84-
}
85-
}
8679
return inputYaml, updated
8780
}
8881

remediation/workflow/pin/pinactions_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ func TestPinActions(t *testing.T) {
182182
{fileName: "basic.yml", wantUpdated: true},
183183
{fileName: "dockeraction.yml", wantUpdated: true},
184184
{fileName: "multipleactions.yml", wantUpdated: true},
185-
{fileName: "actionwithcomment.yml", wantUpdated: true},
186185
}
187186
for _, tt := range tests {
188187
input, err := ioutil.ReadFile(path.Join(inputDirectory, tt.fileName))

testfiles/addaction/input/alreadypresent_2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
- name: Harden Runner
1414
uses: step-security/harden-runner@v2
1515
with:
16-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
16+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
1717

1818
- run: ls -R

testfiles/addaction/output/2jobs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Harden Runner
99
uses: step-security/harden-runner@v2
1010
with:
11-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
11+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
1212

1313
- run: ls -R
1414
list-directory1:
@@ -17,6 +17,6 @@ jobs:
1717
- name: Harden Runner
1818
uses: step-security/harden-runner@v2
1919
with:
20-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
20+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
2121

2222
- run: ls -R

testfiles/addaction/output/action-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Harden Runner
1313
uses: step-security/harden-runner@v2
1414
with:
15-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
15+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
1616

1717
- name: Close Issue
1818
uses: peter-evans/close-issue@v1

testfiles/addaction/output/alreadypresent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
- name: Harden Runner
1414
uses: step-security/harden-runner@v2
1515
with:
16-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
16+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
1717

1818
- run: ls -R

testfiles/addaction/output/alreadypresent_2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
- name: Harden Runner
1414
uses: step-security/harden-runner@v2
1515
with:
16-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
16+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
1717

1818
- run: ls -R

testfiles/pinactions/input/actionwithcomment.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

testfiles/pinactions/output/actionwithcomment.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

testfiles/secureworkflow/output/allscenarios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Harden Runner
1818
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
1919
with:
20-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
20+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
2121

2222
- uses: actions/checkout@544eadc6bf3d226fd7a7a9f0dc5b5bf7ca0675b9 # v1.2.0
2323
- uses: github/super-linter@34b2f8032d759425f6b42ea2e52231b33ae05401 # v3.17.1

testfiles/secureworkflow/output/missingaction.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Harden Runner
1212
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
1313
with:
14-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
14+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
1515

1616
- uses: actions/missingaction@v2
1717
- uses: github/super-linter@34b2f8032d759425f6b42ea2e52231b33ae05401 # v3.17.1

testfiles/secureworkflow/output/noperms.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Harden Runner
1212
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5 # v2.0.0
1313
with:
14-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
14+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
1515

1616
- uses: actions/checkout@544eadc6bf3d226fd7a7a9f0dc5b5bf7ca0675b9 # v1.2.0
1717
- uses: github/super-linter@34b2f8032d759425f6b42ea2e52231b33ae05401 # v3.17.1

testfiles/secureworkflow/output/nopin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Harden Runner
1818
uses: step-security/harden-runner@v2
1919
with:
20-
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs
20+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
2121

2222
- uses: actions/checkout@v1
2323
- uses: github/super-linter@v3

0 commit comments

Comments
 (0)