Match one or more whitespace characters
This commit is contained in:
@@ -19,6 +19,7 @@ describe("isValidCron", () => {
|
||||
"0 0 * * SUN-TUE",
|
||||
"0 0 * * SUN-2",
|
||||
"0 2-4/5 * * *",
|
||||
"0 0 * * *",
|
||||
]
|
||||
|
||||
for (const cron of valid) {
|
||||
|
||||
@@ -27,7 +27,7 @@ const DAYS = {
|
||||
export function isValidCron(cron: string): boolean {
|
||||
// https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
|
||||
|
||||
const parts = cron.split(" ")
|
||||
const parts = cron.split(/ +/)
|
||||
if (parts.length != 5) {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user