diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml
new file mode 100644
index 000000000..aded772b0
--- /dev/null
+++ b/.github/workflows/updatecli.yaml
@@ -0,0 +1,22 @@
+name: updatecli
+
+on:
+ workflow_dispatch:
+ schedule:
+ # * is a special character in YAML so you have to quote this string
+ # Run once a day
+ - cron: '0 0 * * *'
+
+jobs:
+ updatecli:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Apply
+ uses: updatecli/updatecli-action@v1
+ with:
+ flags: "--config updatecli/updatecli.d --values updatecli/values.yaml"
+ env:
+ UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/sample-plugin/pom.xml b/sample-plugin/pom.xml
index 24013f5c9..c12be34d4 100644
--- a/sample-plugin/pom.xml
+++ b/sample-plugin/pom.xml
@@ -14,7 +14,7 @@
999999-SNAPSHOT
weekly
- 2.317
+ 2.316
8
diff --git a/updatecli/updatecli.d/weekly-apply.sh b/updatecli/updatecli.d/weekly-apply.sh
new file mode 100755
index 000000000..0c81d4a25
--- /dev/null
+++ b/updatecli/updatecli.d/weekly-apply.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -eux -o pipefail
+
+# Script "weekly-apply.sh"
+# The script checks the current weekly version in the sample plugin
+# - if different than $1 and DRY_RUN is set to:
+# - "false" then it updates it with the value of $1
+# - "true" then it only reports the value of $1
+# - otherwise it exits without any value reported
+existing_version=$(mvn help:evaluate -f sample-plugin -Dexpression=jenkins.version -q -DforceStdout)
+
+if test "$1" == "$(echo "${existing_version}")"
+then
+ ## No change
+ # early return with no output
+ exit 0
+else
+ if test "$DRY_RUN" == "false"
+ then
+ ## Value changed to $1" - NO dry run
+ mvn versions:set-property -DgenerateBackupPoms=false -Dproperty=jenkins.version -DnewVersion="$1"
+ fi
+ # Report on stdout
+ echo "$1"
+ exit 0
+fi
diff --git a/updatecli/updatecli.d/weekly.yaml b/updatecli/updatecli.d/weekly.yaml
new file mode 100644
index 000000000..adb44e607
--- /dev/null
+++ b/updatecli/updatecli.d/weekly.yaml
@@ -0,0 +1,19 @@
+sources:
+ newVersion:
+ name: Get Jenkins Version
+ kind: maven
+ spec:
+ owner: "maven"
+ url: "repo.jenkins-ci.org"
+ repository: "releases"
+ groupID: "org.jenkins-ci.main"
+ artifactID: "jenkins-war"
+
+targets:
+ default:
+ name: setWeeklyVersion
+ sourceID: newVersion
+ kind: shell
+ spec:
+ command: bash ./updatecli/updatecli.d/weekly-apply.sh
+
diff --git a/updatecli/values.yaml b/updatecli/values.yaml
new file mode 100644
index 000000000..cf6da4970
--- /dev/null
+++ b/updatecli/values.yaml
@@ -0,0 +1,5 @@
+github:
+ user: "GitHub Actions"
+ email: "41898282+github-actions[bot]@users.noreply.github.com"
+ username: "github-actions"
+ token: "UPDATECLI_GITHUB_TOKEN"