Skip to content

Commit f1b059c

Browse files
committed
address CCR review feedback
- narrowVerifiedEntries: set AutoFixedRef to just the ref, not NWO@ref - IsWarning: return false for error-level LocalAction findings - json: only skip warning-level LocalAction findings, not errors - harness edit: use Shellwords.split + system(*cmd, chdir:) instead of interpolating EDITOR into a bash -c string
1 parent 920224a commit f1b059c

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

cmd/gh-actions-lock/format/json.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func WriteJSON(w io.Writer, report *checks.Report, valid bool, fieldsCSV, cliVer
115115
}
116116
for _, wr := range report.Workflows {
117117
for _, f := range wr.Findings {
118-
if f.Category == checks.RunOnly || f.Category == checks.LocalAction || (f.Category == checks.Valid && f.Severity == checks.SeverityOK) {
118+
if f.Category == checks.RunOnly || (f.Category == checks.LocalAction && f.Severity != checks.SeverityError) || (f.Category == checks.Valid && f.Severity == checks.SeverityOK) {
119119
continue
120120
}
121121
allFindings = append(allFindings, findingFromReport(f))
@@ -185,7 +185,7 @@ func WriteJSON(w io.Writer, report *checks.Report, valid bool, fieldsCSV, cliVer
185185
Findings: []Finding{},
186186
}
187187
for _, f := range wr.Findings {
188-
if f.Category == checks.RunOnly || f.Category == checks.LocalAction || (f.Category == checks.Valid && f.Severity == checks.SeverityOK) {
188+
if f.Category == checks.RunOnly || (f.Category == checks.LocalAction && f.Severity != checks.SeverityError) || (f.Category == checks.Valid && f.Severity == checks.SeverityOK) {
189189
continue
190190
}
191191
wf.Findings = append(wf.Findings, findingFromReport(f))

internal/pin/plan.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,11 +607,12 @@ func narrowVerifiedEntries(ctx context.Context, entries []Entry, opts PlanOption
607607
continue
608608
}
609609
}
610-
oldUses := e.NWO + "@" + e.Ref
610+
oldRef := e.Ref
611+
oldUses := e.NWO + "@" + oldRef
611612
newUses := e.NWO + "@" + patchTag
612613
rewrites[oldUses] = newUses
613614
e.Ref = patchTag
614-
e.AutoFixedRef = oldUses
615+
e.AutoFixedRef = oldRef
615616
}
616617
if len(rewrites) == 0 {
617618
return nil

internal/pipeline/checks/finding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (f *Finding) IsWarning() bool {
124124
case f.Category == RefMoved:
125125
return true
126126
case f.Category == LocalAction:
127-
return true
127+
return f.Severity != SeverityError
128128
case f.Category.IsInconclusive():
129129
return true
130130
case f.Category == NotPinned && f.ActionRef == nil:

test/integration/harness.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,9 +1108,9 @@ def shell
11081108
@last_dir
11091109
end
11101110
if dir
1111-
editor = ENV["EDITOR"] || "code"
1112-
puts "\e[2m$ pushd #{dir} && #{editor} && popd\e[0m"
1113-
system("bash", "-c", "pushd #{Shellwords.shellescape(dir)} && #{editor} && popd")
1111+
editor_cmd = Shellwords.split(ENV["EDITOR"] || "code")
1112+
puts "\e[2m$ cd #{dir} && #{editor_cmd.join(' ')}\e[0m"
1113+
system(*editor_cmd, chdir: dir)
11141114
else
11151115
puts "No active scenario directory."
11161116
end

0 commit comments

Comments
 (0)