Skip to content

Commit

Permalink
Merge pull request #220 from olblak/automateVersionUpdate
Browse files Browse the repository at this point in the history
ci: automate wiremock version update
  • Loading branch information
oleg-nenashev authored Oct 25, 2023
2 parents 1e14ade + 36246df commit 72fc436
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/updatecli/updatecli.d/wiremock.yaml
Original file line number Diff line number Diff line change
@@ -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: [email protected]
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'
32 changes: 32 additions & 0 deletions .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 72fc436

Please sign in to comment.