Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: automate wiremock version update #220

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 'docs: bump wiremock version used in the documentation'
olblak marked this conversation as resolved.
Show resolved Hide resolved
pipelineid: "wiremock"

actions:
default:
title: 'docs: update Wiremock version to {{ source "wiremock" }}'
olblak marked this conversation as resolved.
Show resolved Hide resolved
kind: github/pullrequest
scmid: default
spec:
automerge: false
mergemethod: squash
labels:
- chore
olblak marked this conversation as resolved.
Show resolved Hide resolved

scms:
default:
kind: github
spec:
user: wiremock-bot
email: [email protected]
olblak marked this conversation as resolved.
Show resolved Hide resolved
owner: wiremock
repository: wiremock.org
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: main

sources:
wiremock:
name: Get latest Wiremock version
olblak marked this conversation as resolved.
Show resolved Hide resolved
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" }}'
olblak marked this conversation as resolved.
Show resolved Hide resolved
kind: yaml
scmid: default
spec:
file: _config.yml
key: "$.wiremock_version"

wiremock_baseline:
name: 'docs: update Wiremock baseline to {{ source "wiremock" }}'
olblak marked this conversation as resolved.
Show resolved Hide resolved
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 }}