Woodpecker CI plugin to automatically set cron timers for the organization.
  • Go 96%
  • Dockerfile 4%
Find a file
onlyati 997169c7ff
All checks were successful
ci/woodpecker/tag/release Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/cron/vulnerability Pipeline was successful
ci/woodpecker/cron/auto_merge Pipeline was successful
ci/woodpecker/cron/renovate Pipeline was successful
Add remove timer feature (#7)
Resolve #5

Reviewed-on: #7
2026-06-02 19:43:46 +00:00
internal Add remove timer feature (#7) 2026-06-02 19:43:46 +00:00
test_data Implementation of the plugin (#1) 2026-05-25 20:36:03 +00:00
.gitignore Initial commit 2026-05-25 14:27:07 +00:00
.goreleaser.yaml Initial commit 2026-05-25 14:27:07 +00:00
.markdownlint.json Initial commit 2026-05-25 14:27:07 +00:00
.prettierrc Initial commit 2026-05-25 14:27:07 +00:00
Containerfile Update gcr.io/distroless/static-debian13:nonroot Docker digest to dfadf31 #3 2026-05-26 07:23:29 +00:00
go.mod Update module code.thinkaboutit.tech/pandora/woodpecker-utils.gopack to v1.4.0 #6 2026-05-29 07:23:09 +00:00
go.sum Update module code.thinkaboutit.tech/pandora/woodpecker-utils.gopack to v1.4.0 #6 2026-05-29 07:23:09 +00:00
LICENSE Initial commit 2026-05-25 14:27:07 +00:00
main.go Implementation of the plugin (#1) 2026-05-25 20:36:03 +00:00
README.md Implementation of the plugin (#1) 2026-05-25 20:36:03 +00:00
renovate.json Initial commit 2026-05-25 14:27:07 +00:00

Plugin to define cron jobs in Woodpecker CI

This plugin is intended to run with administrative purpose:

  • Automatically enable repositories in Woodpecker CI.
  • Define cron jobs based on external configuration.

Sample timer.ini file:

[wptimer]
patch_daily=0 2 * * *
vulnerability=0 1 * * *
RandomDelayMinutes=50

[test-repo]
patch_daily=0 3 * * *
vulnerability=0 1 * * *

The [foo] indicates the repository name suffix, so the timers are applied for any repository that ends with foo.

The RandomDelayMinutes helps to not concentrate the workload on the server: if specified, it ignores the minute from the timer definition, instead it generates a random number within the interval and uses that.

Every other lines are handled as timer input. The value must follow the cron rules.

Usage

It can be used at any event, but it has two meaningful usage.

Use as CI check

The timer.ini file can be syntax checked during like a push or pull_request events. This is an example to call that.

steps:
  - name: Test timer.ini file
    image: code.thinkaboutit.tech/pandora/timer.woodpecker
    settings:
      mode: ci

Use from timer

When the mode is run, it is not just testing the configuration, but it also do the effective work.

steps:
  - name: Make Woodpecker CI administration maintenance
    image: code.thinkaboutit.tech/pandora/timer.woodpecker
    settings:
      mode: run
      woodpecker_token:
        from_secret: woodpecker-access-token
      forgejo_token:
        from_secret: forgejo-access-token

The Forgejo token must have read:user, read:organization and read:repository.

Settings

Name Default value Description
owner CI_REPO_OWNER Owner of the repository where the timer.ini is.
repo_name CI_REPO_NAME Repository's name where the timer.ini is.
timer_source timer.ini Path until the timer.ini file.
mode This must be ci or run.

Following settings are only needed when mode is run.

Name Default value Description
woodpecker_token Access token for Woodpecker CI
woodpecker_host CI_SYSTEM_URL URL to Woodpecker CI
forgejo_token Access token for Forgejo
forgejo_host CI_FORGE_URL URL to Forgejo instance