Skip to content

Kairos Update

Kairos Update #4

name: "Kairos Update"
on:
workflow_dispatch:
schedule:
- cron: "22 9 * * 0"
push:
branches:
- main
paths:
- ".github/workflows/kairos-update.yaml"
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: workflow/nix-shell-action@v3
id: vars
with:
packages: regctl
script: |
kairos_image_tag=$(regctl tag ls quay.io/kairos/opensuse \
--include 'leap-\d+.\d+-standard-amd64-generic.*' \
--exclude '.*(master|alpha|beta|rc).*' \
| tail -1)
echo $kairos_image_tag
leap_version="$(cut -d'-' -f2 <<< $kairos_image_tag)"
echo $leap_version
echo "opensuse_url=https://doc.opensuse.org/release-notes/x86_64/openSUSE/Leap/$leap_version/" >> $GITHUB_OUTPUT
replacement_pattern='s|version: "[^"]*"|version: "'"$kairos_image_tag"'"|g'
sed -i "$replacement_pattern" ./system-upgrade/system-upgrade-controller/plans/amd.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update karios version
title: 'Update kairos version'
draft: false
branch: chore/update-kairos
delete-branch: true
body: |
Update report
- ${{ steps.vars.outputs.opensuse_url }}
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request