Skip to content

Commit

Permalink
action: update GHA for PR creation
Browse files Browse the repository at this point in the history
    - That we can avoid patch again when create specific stable branch

Signed-off-by: Vicente Cheng <vicente.cheng@suse.com>
  • Loading branch information
Vicente-Cheng committed Jul 5, 2024
1 parent 785f4dd commit 8e089b8
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion .github/workflows/installer-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
container:
image: registry.suse.com/bci/bci-base:15.4
steps:
- uses: jungwinter/split@v2
id: spliter
with:
msg: ${{ github.ref_name }}
separator: '-'
- name: Install docker
run: zypper ref && zypper -n install docker
- name: Pull new image
Expand All @@ -27,7 +32,7 @@ jobs:
chmod +x /usr/bin/container-diff
- name: Get current OS image from installer
run: |
curl -sfL https://raw.githubusercontent.com/harvester/harvester-installer/master/scripts/package-harvester-os -o /tmp/package-harvester-os
curl -sfL https://raw.githubusercontent.com/harvester/harvester-installer/${{ steps.spliter.outputs._0 }}/scripts/package-harvester-os -o /tmp/package-harvester-os
grep '^BASE_OS_IMAGE="rancher/harvester-os:' /tmp/package-harvester-os > /tmp/tmp-env
- name: Run container-diff
run: |
Expand Down Expand Up @@ -95,3 +100,42 @@ jobs:
```
${{ steps.read.outputs.content }}
```
create-addon-pr:
runs-on: ubuntu-latest
needs: generate-image-diff
steps:
- uses: jungwinter/split@v2
id: spliter
with:
msg: ${{ github.ref_name }}
separator: '-'
- name: Clone Addons repo
uses: actions/checkout@v3
with:
repository: harvester/addons
ref: ${{ steps.spliter.outputs._0 }}
- name: Update nvidia driver toolkit tag
run: |
sed -i "/tag:/ {N; /harvester-nvidia-driver-toolkit/ s/tag:.*\n/tag: ${{ github.ref_name }}\n/}" pkg/templates/rancherd-22-addons.yaml
- name: Create Addons PR
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.BOT_TOKEN }}
commit-message: Bump nvidia-driver-toolkit ${{ github.ref_name }}
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: bump-nv-driver-${{ github.ref_name }}
delete-branch: true
title: 'Bump nvidia-driver-toolkit ${{ github.ref_name }}'
draft: false
body: |
**Problem:**
The nvidia driver toolkit needs to update.
**Solution:**
Bump nvidia driver toolkit image as related baseos [${{ env.IMAGE_NAME }}](https://github.com/harvester/os2/releases/tag/${{ github.ref_name }}).
**Related Issue:**
**Test plan:**

0 comments on commit 8e089b8

Please sign in to comment.