Skip to content

Commit 5633482

Browse files
committed
copy: explain how to replace orphaned SHA refs
1 parent 2fca8dc commit 5633482

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

internal/resolve/discover_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ func TestReverseLookup_FailsClosedOnImpostor(t *testing.T) {
389389
if issues[0].NWO != "actions/checkout" {
390390
t.Errorf("expected NWO=actions/checkout, got %q", issues[0].NWO)
391391
}
392+
want := "this commit has no exact tag and is not on any branch — update the workflow to use a current upstream tag or branch, then rerun"
393+
if issues[0].Message != want {
394+
t.Errorf("message = %q, want %q", issues[0].Message, want)
395+
}
392396
}
393397

394398
type roundTripFunc func(*http.Request) (*http.Response, error)

internal/resolve/reverse_lookup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func (r *Resolver) ReverseLookup(ctx context.Context, deps []dep.Dependency) (ma
279279
if tag == "" && branch == "" {
280280
var msg string
281281
if LooksLikeSHA(d.Ref) {
282-
msg = fmt.Sprintf("no tag or branch contains this commit — a symbolic ref is required for the lockfile")
282+
msg = "this commit has no exact tag and is not on any branch — update the workflow to use a current upstream tag or branch, then rerun"
283283
} else {
284284
msg = fmt.Sprintf("commit %s is not reachable from any ref (tag or branch) — orphaned commit",
285285
parserlock.ShortSHA(d.SHA))

0 commit comments

Comments
 (0)