Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions types/githubactions-definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://packageurl.org/schemas/purl-type-definition.schema-1.0.json",
"$id": "https://packageurl.org/types/githubactions-definition.json",
"type": "githubactions",
"type_name": "GitHub Actions",
"description": "GitHub Actions including workflows",
"repository": {
"use_repository": true,
"note": "Github.com is the Actions repository."
},
"namespace_definition": {
"requirement": "required",
"case_sensitive": false,
"note": "The namespace must be lowercased."
},
"name_definition": {
"requirement": "required",
"case_sensitive": true,
"note": "The name contains both the repository name and optionally a path within the repository to a certain action or workflow. The first section before the slash is the repository name, this is not case sensitive and should be lowercase. The rest is the path within the repository, which is case sensitive."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't accurate. The name begins at the last slash. The complicated part with the partial case sensitivity is in the namespace.

There's sort of a precedent for this. pkg:golang doesn't really have namespace and name and you get the same kind of thing where the PURL "namespace" is just the part of the Go name before the first slash, but the Go module system enforces case sensitivity even when GitHub (or wherever the package is hosted) allows the files to be retrieved with different case and that avoids having to write custom normalization rules. Some people don't like pkg:golang and want to redo it with everything being in PURL name and nothing in the PURL namespace, in which case every slash would need to be percent encoded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, looking at Go test cases https://github.com/package-url/purl-spec/blob/505dca561f6d6f1f1f0ebb6b5c36c6aa2516d98d/tests/types/golang-test.json
So in this case most of it would be the name, would have to be url encoded or the base purl format would need to be changed. Leveraging the subpath doesn't seem fitting.

},
"note": "GitHub Actions, including workflows.",
"version_definition": {
"requirement": "optional",
"note": "The version is often empty when a commit is not specified and should be the commit in most cases when available."
},
"examples": [
"pkg:githubactions/myorg/myaction",
"pkg:githubactions/myorg/myworkflows/.github/workflows/general.yml",
"pkg:githubactions/myorg/myaction@v1",
"pkg:githubactions/myorg/myworkflows/.github/workflows/general.yml@v1"
]
}