Skip to content

feat(purl): add PURL conversion for the GitHub Actions ecosystem - #6303

Closed
Jah-yee wants to merge 1 commit into
google:masterfrom
Jah-yee:feat/purl-github-actions
Closed

Jah-yee wants to merge 1 commit into
google:masterfrom
Jah-yee:feat/purl-github-actions

Conversation

@Jah-yee

@Jah-yee Jah-yee commented Nov 3, 2026

Copy link
Copy Markdown

Overview

Adds the missing PURL conversion for the GitHub Actions OSV ecosystem.

The checklist in #2402 still has GitHub Actions (github?) unticked, and no
PURL entry existed for it, so GitHub Actions advisories had no PURL
representation in the API output.

This change maps the ecosystem to the github PURL type, so a package such as
actions/checkout is rendered as pkg:github/actions/checkout and parses back
to the original actions/checkout name (with an optional version).

Refs #2402

Details

  • osv/purl_helpers.py: add 'GitHub Actions': EcosystemPURL('github', None)
    to ECOSYSTEM_PURL_DATA, and allow the github PURL type to re-join the
    namespace and name when parsing (pkg:github/<owner>/<repo>).
  • go/purl/ecosystems_simple.go: register the same mapping with
    registerSlash(osvconstants.EcosystemGitHubActions, "github"), which
    splits the owner/repo package name into the PURL namespace and name and
    joins them again when parsing.
  • osv/purl_helpers_test.py and go/purl/purl_test.go: unit tests for
    package-to-PURL and PURL-to-package in both directions.

Both implementations are covered so the Python library
(osv/models.py uses purl_helpers.package_to_purl) and the Go worker
pipeline (go/internal/worker/pipeline/purl) stay consistent.

Testing

  • python3 -m unittest osv.purl_helpers_test (3 tests, OK)
  • go test ./purl/ in go/ (ok)
  • gofmt applied to the modified Go files

Note

This contribution is AI-assisted: the change was drafted by an AI agent and
reviewed by the human submitter.

Maps the OSV 'GitHub Actions' ecosystem to the 'github' PURL type, so
packages such as 'actions/checkout' are rendered as
'pkg:github/actions/checkout' and parse back to the original name.

Adds the mapping to both the Python helper (osv/purl_helpers.py) and the
Go PURL registry (go/purl), plus unit tests for both directions.

Refs google#2402
@G-Rath

G-Rath commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Please read our contributing guide before opening pull requests

@G-Rath G-Rath closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants