diff --git a/.github/updatecli/updatecli.d/wiremock.yaml b/.github/updatecli/updatecli.d/wiremock.yaml new file mode 100644 index 00000000..631af76a --- /dev/null +++ b/.github/updatecli/updatecli.d/wiremock.yaml @@ -0,0 +1,66 @@ +name: 'Bump WireMock version' +pipelineid: "wiremock" + +actions: + default: + title: 'docs: update WireMock version to {{ source "wiremock" }}' + kind: github/pullrequest + scmid: default + spec: + automerge: false + mergemethod: squash + labels: + - documentation + +scms: + default: + kind: github + spec: + user: wiremock-bot + email: release-bot@wiremock.org + owner: wiremock + repository: wiremock.org + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + username: '{{ requiredEnv "GITHUB_ACTOR" }}' + branch: main + +sources: + wiremock: + name: Get latest WireMock version + kind: githubrelease + spec: + owner: wiremock + repository: wiremock + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + versionfilter: + kind: semver + +conditions: + docker: + name: 'Check that a docker image is available for the latest version' + kind: dockerimage + spec: + image: wiremock/wiremock + architecture: amd64 + +targets: + wiremock_version: + name: 'docs: update WireMock version to {{ source "wiremock" }}' + kind: yaml + scmid: default + spec: + file: _config.yml + key: "$.wiremock_version" + + wiremock_baseline: + name: 'docs: update WireMock baseline to {{ source "wiremock" }}' + kind: yaml + scmid: default + spec: + file: _config.yml + key: "$.wiremock_baseline" + transformers: + - findsubmatch: + pattern: '^(\d*).' + captureindex: 1 + - addsuffix: '.x' \ No newline at end of file diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml new file mode 100644 index 00000000..f3aafbcf --- /dev/null +++ b/.github/workflows/updatecli.yaml @@ -0,0 +1,32 @@ +--- +name: "Updatecli" + +on: + workflow_dispatch: + schedule: + # * is a special character in YAML so you have to quote this string + # trigger every hour the following pipeline + - cron: '0 * * * *' + +permissions: + contents: write + pull-requests: write + +jobs: + updatecli: + runs-on: ubuntu-latest + # Ensure we only run the following pipeline from main branch + # with a GITHUB_TOKEN that has "contents: write" permission + if: github.ref == 'refs/heads/main' + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Updatecli Binary + uses: updatecli/updatecli-action@v2 + + - name: Run Updatecli in enforce mode + run: "updatecli apply --config .github/updatecli/updatecli.d" + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}