Set env variables for scheduled workflow based on cron expression #25928
-
I want to reuse my workflow jobs scheduling them at various times of the day but with different input
but I assume this is not supported? I can obviously run some custom command/script that will check current date and (assuming that I give it some tolerance in terms of exact minute) set the correct value of I’ll appreciate any ideas :slight_smile: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @andrzej-kodify, Glad to see you in Github Community Forum! You cannot define top level env in the event, it’s not supported. As an alternative, based on the different schedule cron settting, you can use ‘set-env’ to set/update env value for the job. Code sample as below:
the var ‘cronenv’ has different value based on the different cron setting. Thanks |
Beta Was this translation helpful? Give feedback.
-
Great, that’s the workaround I’ve been after. Thanks a lot :slight_smile: |
Beta Was this translation helpful? Give feedback.
-
Any news on this? This would be very helpful to us, too. Schedules may change over time, names or IDs dont. |
Beta Was this translation helpful? Give feedback.
Hi @andrzej-kodify,
Glad to see you in Github Community Forum!
You cannot define top level env in the event, it’s not supported. As an alternative, based on the different schedule cron settting, you can use ‘set-env’ to set/update env value for the job.
Code sample as below: