Skip to content

Commit b1c847f

Browse files
sachin-sandhujclement136
andauthoredApr 25, 2025··
Changes for cronjob related changes and additional scheduling options (#55365)
Co-authored-by: John Clement <70238417+jclement136@users.noreply.github.com>
1 parent 7b80710 commit b1c847f

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed
 

‎content/code-security/dependabot/working-with-dependabot/dependabot-options-reference.md

+40-2
Original file line numberDiff line numberDiff line change
@@ -482,18 +482,22 @@ Reviewers must have at least read access to the repository.
482482
| `interval` | **Required.** Defines the frequency for {% data variables.product.prodname_dependabot %}. |
483483
| `day` | Specify the day to run for a **weekly** interval. |
484484
| `time` | Specify the time to run. |
485+
| `cronjob` | Defines the cron expression if the interval type is `cron`. |
485486
| `timezone` | Specify the timezone of the `time` value. |
486487

487488
### `interval`
488489

489-
Supported values: `daily`, `weekly`, or `monthly`
490+
Supported values: `daily`, `weekly`, `monthly`, `quarterly`, `semiannually`, `yearly`, or `cron`
490491

491492
Each package manager **must** define a schedule interval.
492493

493494
* Use `daily` to run on every weekday, Monday to Friday.
494495
* Use `weekly` to run once a week, by default on Monday.
495496
* Use `monthly` to run on the first day of each month.
496-
497+
* Use `quarterly` to run on the first day of each quarter (January, April, July, and October).
498+
* Use `semiannually` to run every six months, on the first day of January and July.
499+
* Use `yearly` to run on the first day of January.
500+
* Use `cron` for cron expression based scheduling option. See [`cronjob`](#cronjob).
497501
By default, {% data variables.product.prodname_dependabot %} randomly assigns a time to apply all the updates in the configuration file. You can use the `time` and `timezone` parameters to set a specific runtime for all intervals.
498502

499503
### `day`
@@ -508,6 +512,40 @@ Format: `hh:mm`
508512

509513
Optionally, run all updates for a package manager at a specific time of day. By default, times are interpreted as UTC.
510514

515+
### `cronjob`
516+
517+
Supported values: Valid cron expression in cron format or natural expression.
518+
519+
Examples : `0 9 * * *`, `every day at 5pm`
520+
521+
cron format is defined as the following:
522+
* `*` The minute field.
523+
* `*` The hour field (in 24-hour time).
524+
* `*` The day of the month (matches any day of the month).
525+
* `*` The month (matches any month).
526+
* `*` The day of the week (matches any day of the week).
527+
528+
`0 9 * * *` is equivalent to "every day at 9am". `every day at 5pm` is equivalent to `0 17 * * *`.
529+
530+
> [!NOTE]
531+
> A `cronjob` type schedule is required to use a `cron` interval.
532+
533+
```yaml copy
534+
535+
# Basic `dependabot.yml` file for cronjob
536+
537+
version: 2
538+
updates:
539+
# Enable version updates for npm
540+
- package-ecosystem: "npm"
541+
# Look for `package.json` and `lock` files in the `root` directory
542+
directory: "/"
543+
# Check the npm registry for updates based on `cronjob` value
544+
schedule:
545+
interval: "cron"
546+
cronjob: "0 9 * * *"
547+
```
548+
511549
### `timezone`
512550

513551
Specify a time zone for the `time` value.

0 commit comments

Comments
 (0)
Please sign in to comment.