docker / docker/metadata-action
Add a `{{ license }}` global expression
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 160
- Avg merge
- 4d 17h
- Merged PRs (30d)
- 12
Description
Description
The equivalent expression in Github Actions is invalid as ? syntax is not supported.
The labels/annotations entry would instead look like this:
org.opencontainers.image.licenses=${{ github.event.repository.license && github.event.repository.license.spdx_id }}
This is effectively the only label/annotation that can't easily / tersely be expressed, so the {{ license }} handlebars global expression would be convenient.
There isn't much reason to add this other than choosing to be more explicit about the values (I documented such here) as the defaults aren't publicly documented by this action, one must look them up via source:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/meta.ts at the linked metadata defaults around line 549, then trace how global expressions are defined and exposed to labels or annotations. The work is done when a {{ license }} expression can provide the repository license SPDX identifier in the documented YAML entry without relying on unsupported ? syntax.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd, devops
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100