Skip to content

How to get the current time as an environment variable in actions? #26342

Discussion options

You must be logged in to vote

It looks like you’re sending the date into ${TIME} instead of $GITHUB_ENV. To set an environment variable you need to send it to $GITHUB_ENV in the following format:

echo "{name}={value}" >> $GITHUB_ENV

docs.github.com

Workflow commands for GitHub Actions - GitHub Docs

Replies: 9 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants