update #1490
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |