Skip to content

Add commit timestamp environment variables#6635

Closed
AkashKumar7902 wants to merge 1 commit into
woodpecker-ci:mainfrom
AkashKumar7902:codex/add-commit-timestamp-env
Closed

Add commit timestamp environment variables#6635
AkashKumar7902 wants to merge 1 commit into
woodpecker-ci:mainfrom
AkashKumar7902:codex/add-commit-timestamp-env

Conversation

@AkashKumar7902

Copy link
Copy Markdown
Contributor

Summary

  • carry pipeline commit timestamps into runtime metadata
  • expose CI_COMMIT_TIMESTAMP and CI_PREV_COMMIT_TIMESTAMP as UTC RFC3339 values when commit timestamps are available
  • document the new environment variables and cover current/previous commit timestamp export in tests

Closes #5245

Validation

  • go test -race -tags test ./pipeline/frontend/metadata ./server/pipeline/metadata -run 'TestEnviron|TestGetWorkflowMetadata' -count=1 -v
  • go test -race -tags test ./pipeline/frontend/metadata ./server/pipeline/... -count=1
  • make test-lib
  • make test-server

@qwerty287

Copy link
Copy Markdown
Contributor

Thanks to be consistent with other vars like CI_PIPELINE_CREATED, can we use a Unix timestamp?

@qwerty287 qwerty287 added server enhancement improve existing features and removed server labels May 26, 2026
Comment thread server/pipeline/metadata/metadata.go
@6543

6543 commented May 26, 2026

Copy link
Copy Markdown
Member

also cli needs patch to allow setting it

@qwerty287

Copy link
Copy Markdown
Contributor

added cli and changed to unix timstamps in #6670

@qwerty287 qwerty287 closed this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement improve existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add env CI_COMMIT_TIMESTAMP

3 participants