Open fryz opened 1 year ago
👋 @fryz Thank you for raising your pull request. Please make sure you have followed our contributing guidelines. We will review it as soon as possible
For now I've managed to workaround this using a separate step to check the date and fail the workflow if it isn't within the expected range. I'll post this here in case there are others looking to do something similar.
- name: Checks that current date is between date range
id: check-dates
run: |
today=$(date +'%s')
start=$(date -d 2022-11-24 +%s)
end=$(date -d 2022-11-28 +%s)
if [[ $today -gt $start && $today -lt $end ]] ; then
exit 0
else
exit 1
fi
Description
Add a
startDate
andendDate
parameters, which are used to configure the behavior of executing the auto-comment workflow. Either or bothstartDate
andendDate
can be provided, and the current time is checked agains these dates to determine if the workflow can be executed.The
startDate
andendDate
parameters are not required, and as such, this feature is backwards compatible.Motivation and Context
I want to support the case where we auto-comment only within a specific date-window. For example, if the company is on a company-wide holiday, I want to configure the auto-commenter to message out that the company is on break and what that means for providing support during this time.
Types of changes
Self Check before Merge