You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d2a970a
Browse filesBrowse the repository at this point in the historyBrowse files
* Spell full SHAs one way in the lockfile and workflows
The Actions backend matches a `uses:` ref to its lockfile key exactly, so a
full SHA must be spelled the same in both. Lockfile loads lowercase full
SHAs in keys, refs, commits, `uses:` and workflow roots, merging duplicate
spellings and rejecting ones that disagree. A workflow `uses:` with an
uppercase full SHA is a fixable finding, and fix runs lowercase it. A
remote composite that spells a child SHA in uppercase can't be locked.
Also reject what the backend can't run: a ref containing `@` anywhere, and
one repository locked on two hosts.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Match uppercase full-SHA uses to lowercase keys without rewriting them
The Actions backend lowercases full-SHA refs before it looks them up, so a
workflow can keep the spelling it was written with. Workflow refs are
lowercased once, where they are parsed, and a planned rewrite of a
full-SHA use is applied to the spelling the source has. Drop the uppercase
finding and the uppercase-composite-child rejection.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Never record a ref with @, and merge spellings whatever their child order
Reverse lookup could pick a tag or branch containing @, which the Actions
backend rejects in `uses:`. Duplicate spellings of one entry now compare
their children as the set Save writes.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
returnnil, &contentError{fmt.Sprintf("%s: entry for %s %s", where, pinKey, entryRefError(pin, action.Ref))}
198
203
}
204
+
pin.Ref=CanonicalRef(pin.Ref)
205
+
action.Ref=CanonicalRef(action.Ref)
206
+
action.Commit=strings.ToLower(action.Commit)
207
+
action.Uses=canonicalKeys(action.Uses)
199
208
canon:=pin.String()
209
+
ifprev, dup:=normalizedDependencies[canon]; dup {
210
+
if!reflect.DeepEqual(prev, action) {
211
+
returnnil, &contentError{fmt.Sprintf("%s: entries %s and %s spell one full SHA in different cases but record different dependencies", where, spelledAs[canon], pinKey)}
212
+
}
213
+
continue
214
+
}
200
215
normalizedDependencies[canon] =action
216
+
spelledAs[canon] =pinKey
201
217
ifaction.OwnerID!=0&&action.RepoID!=0 {
202
218
// idCache is keyed by lowercase owner/repo to match lookupIDs and the
203
219
// canonical pin reader; mixed-case keys here would silently miss.
return&contentError{fmt.Sprintf("%s: %s is locked on both %s and %s; a repository can be locked on only one host", parserlock.Path, pin.NWO, prev, host)}
275
+
}
276
+
hosts[pin.NWO] =host
277
+
}
278
+
returnnil
279
+
}
280
+
259
281
// File returns the in-memory parser-level lockfile snapshot. Intended for
260
282
// consumers that drive the workflow-parser diagnostics engine directly and
261
283
// need the whole file (workflow keys + actions metadata) in one shot.
0 commit comments