Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOURCE_DATE_EPOCH is not respected #403

Open
Pesa opened this issue Apr 6, 2024 · 4 comments
Open

SOURCE_DATE_EPOCH is not respected #403

Pesa opened this issue Apr 6, 2024 · 4 comments

Comments

@Pesa
Copy link

Pesa commented Apr 6, 2024

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.

@crazy-max
Copy link
Member

Sounds good thanks

@lvjp
Copy link

lvjp commented Sep 29, 2024

I think that this is related to the code in src/meta.ts :

this.date = new Date();

For now, I have a little workaround :

- id: git-timestamp
  run: echo "iso8601=$(git log -n1 --pretty=%cI)" >> "${GITHUB_OUTPUT}"

- uses: docker/[email protected]
  id: meta
  with:
    labels: "org.opencontainers.image.created=${{ steps.git-timestamp.outputs.iso8601 }}"

@trim21
Copy link
Contributor

trim21 commented Nov 13, 2024

will #471 works for you?

@trim21
Copy link
Contributor

trim21 commented Nov 14, 2024

looks like they are not same, but it will help fixing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants