docker / docker/metadata-action

`SOURCE_DATE_EPOCH` is not respected

Open
#403 4 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
TypeScript
Stars
1.1k
Forks
160
Avg merge
4d 17h
Merged PRs (30d)
12

Description

Description

metadata-action does not seem to honor the SOURCE_DATE_EPOCH env variable when generating labels and annotations such as org.opencontainers.image.created. I know these can be overridden by the calling workflow, but it would be nice if the action supported SOURCE_DATE_EPOCH by default, for a better out-of-the-box experience.

I'm not sure if SOURCE_DATE_EPOCH should also affect tags that use the {{date}} expression. Personally I don't think it should. Maybe a new expression {{source_date_epoch}} can be added that takes the timestamp from the env variable and formats it as specified, instead of using the current time, but this can be considered separately later.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the action's label and annotation generation, then inspect how the existing {{date}} expression obtains its timestamp. Confirm how SOURCE_DATE_EPOCH should affect generated metadata, decide whether {{date}} remains unchanged, and add tests showing the intended behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, 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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.