-
Notifications
You must be signed in to change notification settings - Fork 251
42 lines (40 loc) · 1.4 KB
/
update.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: update
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
kyverno:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup yq
uses: fluxcd/pkg/actions/yq@main
- name: Fetch latest version
id: version
run: |
REPO="https://github.com/kyverno/kyverno.git"
VERSION=$(cd /tmp && 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=NUMBER::${VERSION}
- name: Patch version
env:
KYVERNO_VERSION: ${{ steps.version.outputs.NUMBER }}
run: yq e '.spec.ref.tag=strenv(KYVERNO_VERSION)' -i ./infrastructure/kyverno/source.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
branch: update-kyverno
committer: GitHub <[email protected]>
author: fluxcdbot <[email protected]>
signoff: true
commit-message: Update kyverno to ${{ steps.version.outputs.NUMBER }}
title: Update kyverno to ${{ steps.version.outputs.NUMBER }}
body: |
kyverno ${{ steps.version.outputs.NUMBER }}