Repository navigation
Add githubactions ecosystem - #123
Merged
andrew merged 1 commit intoOct 28, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #85.
Problem
git-pkgs/manifestsparses.github/workflows/*.ymlintopkg:githubactions/<owner>/<repo>@<ref>dependencies, butNewFromPURLrejected the type:Consumers that fetch artifacts, such as
licenses --license-textor integrity verification, had to skip the whole ecosystem.Change
New
internal/githubactionsregistry, registered asgithubactionswithhttps://api.github.comas the default URL.Names
NewFromPURLpassesp.FullName()to the registry, so it receivesactions/checkoutor, for a subdirectory action,github/codeql-action/init. The first two segments are the owner and repo; anything after them is the subdirectory inside that repo.pkg:githubactions/actions/checkout@v4actions/checkoutpkg:githubactions/github/codeql-action/init@v3github/codeql-actioninitRegistry methods
FetchPackageGET /repos/{owner}/{repo}: description, homepage (falls back to the repo page), repository, SPDX license (NOASSERTIONdropped), topics as keywords, owner as namespace. Metadata carriesfull_name,default_branch,archivedand the subdirectorypath.FetchVersionsGET /repos/{owner}/{repo}/tags, 100 per page until a short page. Each version keeps its commit SHA in metadata. Branches and SHAs are valid refs but are not enumerated.FetchDependencieserrors.ErrUnsupportedFetchMaintainerserrors.ErrUnsupportedRequests send
Accept: application/vnd.github+json. A 404 becomesNotFoundError.The issue suggested returning
nilfrom theFetch*methods as a first cut. I implemented package and tag lookups instead, since both are single REST calls. The unsupported operations follow the existingswiftconvention of wrappingerrors.ErrUnsupported, which avoidsnil, nilresults that callers could dereference.URLs
Downloadhttps://github.com/actions/checkout/archive/v4.tar.gz(empty without a ref)Registry/Documentationhttps://github.com/github/codeql-action/tree/v3/initPURLpkg:githubactions/github/codeql-action/init@v3Downloadaccepts tags, branches or 40-char SHAs. Refs containing slashes, such asreleases/v1, keep their path structure. For subdirectory actions the tarball is the whole repository.For GitHub Enterprise Server, an
/api/v3base URL also sets the web host used for page and archive links.Wiring
all/all.goimports the new package; the ecosystem list in its doc comment includesgithubactions.TestSupportedEcosystems,TestNewandTestDefaultURLinclude the new ecosystem.Known limitations
/archive/<ref>.tar.gzis generated on demand and GitHub does not guarantee byte stability, so versions carry noIntegrity. Stable release assets could be a follow-up for actions that publish them.URLs().Downloadmakes no API call, but bulk metadata lookups will hit the limit quickly. Token support could be a follow-up.fetch.Resolvernames files from the last URL segment, so every action atv4downloads asv4.tar.gz. Callers that cache by filename alone should key on the full name too.Tests
internal/githubactions/githubactions_test.gocovers:FetchPackagefield mapping and the Accept header,NOASSERTIONhandling, the homepage fallback, 404 toNotFoundErrorand invalid names;FetchVersionspagination across two pages (101 tags), an empty tag list and 404;ErrUnsupportedfromFetchDependenciesandFetchMaintainers;core.NewFromPURLend to end foractions/checkout@v4andgithub/codeql-action/init@v3.Locally,
gofmt -l .is clean.go vet ./...,go test -race ./...andgolangci-lint run ./...pass, as do thejsandwasip1wasm builds and thetinygotagged tests.