forked from ibuildthecloud/os2
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GHA: move peter-evans/create-pull-request to GH CLI
Signed-off-by: Vicente Cheng <[email protected]> (cherry picked from commit 6013937) # Conflicts: # .github/workflows/installer-pr.yml
- Loading branch information
1 parent
390f035
commit f2d20dc
Showing
1 changed file
with
59 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,46 +37,43 @@ jobs: | |
echo "Diff $BASE_OS_IMAGE with ${{ env.IMAGE_NAME }}..." | ||
container-diff diff daemon://docker.io/$BASE_OS_IMAGE daemon://docker.io/${{ env.IMAGE_NAME }} --type=rpm --output=diff-result.txt | ||
cat diff-result.txt | ||
- name: Set diff result to environment variable | ||
run: | | ||
echo "packagesDiff<<EOF" >> $GITHUB_ENV | ||
cat diff-result.txt >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Clone harvester-installer repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: harvester/harvester-installer | ||
ref: ${{ env.targetVersion }} | ||
- name: Update os image | ||
run: sed -i "s,^BASE_OS_IMAGE=.*,BASE_OS_IMAGE=\"${{ env.IMAGE_NAME }}\"," scripts/package-harvester-os | ||
- name: Create installer PR | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ secrets.BOT_TOKEN }} | ||
commit-message: Bump OS ${{ inputs.tag }} | ||
committer: GitHub <[email protected]> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
team-reviewers: os | ||
signoff: false | ||
branch: bump-os-${{ inputs.tag }} | ||
delete-branch: true | ||
title: 'Bump OS ${{ inputs.tag }}' | ||
draft: false | ||
body: | | ||
**Problem:** | ||
Harvester base OS needs to update. | ||
**Solution:** | ||
Bump OS image to [${{ env.IMAGE_NAME }}](https://github.com/harvester/os2/releases/tag/${{ inputs.tag }}). | ||
**Related Issue:** | ||
**Test plan:** | ||
- name: Create PR Content | ||
run: | | ||
echo "prContent<<EOF" >> $GITHUB_ENV | ||
echo "**Problem:**" >> $GITHUB_ENV | ||
echo "Harvester base OS needs to update." >> $GITHUB_ENV | ||
echo "" >> $GITHUB_ENV | ||
echo "**Solution:**" >> $GITHUB_ENV | ||
echo "Bump OS image to [${{ env.IMAGE_NAME }}](https://github.com/harvester/os2/releases/tag/${{ inputs.tag }})." >> $GITHUB_ENV | ||
echo "" >> $GITHUB_ENV | ||
echo "**Related Issue:**" >> $GITHUB_ENV | ||
echo "" >> $GITHUB_ENV | ||
echo "**Test plan:**" >> $GITHUB_ENV | ||
echo "" >> $GITHUB_ENV | ||
echo "**More info:**" >> $GITHUB_ENV | ||
cat diff-result.txt >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
**More info:** | ||
``` | ||
${{ env.packagesDiff }} | ||
``` | ||
- name: Create installer PR | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | ||
run: | | ||
git add . | ||
git commit -m "Bump OS ${{ inputs.tag }}" --author="${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" | ||
git push origin HEAD:bump-os-${{ inputs.tag }} | ||
gh pr create \ | ||
--base {{ env.targetVersion }} \ | ||
--head bump-os-${{ inputs.tag }} \ | ||
--reviewer "harvester/os" \ | ||
--title "Bump OS ${{ inputs.tag }}" \ | ||
--body ${{ env.prContent }} | ||
create-addon-pr: | ||
runs-on: ubuntu-latest | ||
|
@@ -92,7 +89,22 @@ jobs: | |
- name: Update nvidia driver toolkit tag | ||
run: | | ||
sed -i "/tag:/ {N; /harvester-nvidia-driver-toolkit/ s/tag:.*\n/tag: ${{ inputs.tag }}\n/}" pkg/templates/rancherd-22-addons.yaml | ||
- name: create PR content | ||
run: | | ||
echo "prContent<<EOF" >> $GITHUB_ENV | ||
echo "**Problem:**" >> $GITHUB_ENV | ||
echo "The nvidia driver toolkit needs to update." >> $GITHUB_ENV | ||
echo "" >> $GITHUB_ENV | ||
echo "**Solution:**" >> $GITHUB_ENV | ||
echo "Bump nvidia driver toolkit image as related baseos [${{ env.IMAGE_NAME }}](https://github.com/harvester/os2/releases/tag/${{ inputs.tag }})." >> $GITHUB_ENV | ||
echo "" >> $GITHUB_ENV | ||
echo "**Related Issue:**" >> $GITHUB_ENV | ||
echo "" >> $GITHUB_ENV | ||
echo "**Test plan:**" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Create Addons PR | ||
<<<<<<< HEAD | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ secrets.BOT_TOKEN }} | ||
|
@@ -115,4 +127,18 @@ jobs: | |
**Related Issue:** | ||
**Test plan:** | ||
======= | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | ||
run: | | ||
git add . | ||
git commit -m "Bump nvidia-driver-toolkit ${{ inputs.tag }}" --author="${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" | ||
git push origin HEAD:bump-nv-driver-${{ inputs.tag }} | ||
gh pr create \ | ||
--base {{ env.targetVersion }} \ | ||
--head bump-nv-driver-${{ inputs.tag }} \ | ||
--reviewer "harvester/os" \ | ||
--title "Bump nvidia-driver-toolkit ${{ inputs.tag }}" \ | ||
--body ${{ env.prContent }} \ | ||
>>>>>>> 6013937 (GHA: move peter-evans/create-pull-request to GH CLI) |