Replies: 1 comment
-
|
Having a similar issue with this cron schedule that I only want to run on the first Monday of the month the GitHub Actions editor explains it as
My action is currently triggering daily from the 1st to the 7th of the month and all Mondays, which is not ideal. I didn't really want to add an initial job step to check "is it Monday?", but that feels like the only workaround for this at the moment. on:
schedule:
- cron: '0 4 1-7 * *'
jobs:
do-it:
runs-on: ubuntu-latest
steps:
- name: Schedule - Only run on Monday
if: ${{ github.event_name == 'schedule' }}
run: |
if [ "$(date +%u)" -ne 1 ]; then
echo "It's not Monday, exiting"
exit 1
fi |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Questions
Body
on: schedule: - cron: '40 9 22-28 1,5,9 2'Given the above schedule, it's expected the job runs at "09:40 on every day-of-month from 22 through 28 and on Tuesday in January, May, and September.”
How to make it runs on the only Tuesday that is within the 22nd and 28th of the Month (Jan, May, September)?
Beta Was this translation helpful? Give feedback.
All reactions