Skip to content

Commit 668b95c

Browse files
committed
Improve
1 parent 1e5fff1 commit 668b95c

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.github/workflows/check-kernel-release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ jobs:
5353
env:
5454
GH_TOKEN: ${{ secrets.KERNEL_UPDATE_TOKEN }}
5555

56+
- name: Generate branch name
57+
if: steps.check.outputs.new_release == 'true'
58+
id: branch
59+
run: |
60+
BRANCH_NAME="kernel-upgrade-$(uuidgen | tr '[:upper:]' '[:lower:]')"
61+
echo "name=$BRANCH_NAME" >> $GITHUB_OUTPUT
62+
echo "Branch name: $BRANCH_NAME"
63+
5664
- name: Set up git credentials
5765
if: steps.check.outputs.new_release == 'true'
5866
run: |
@@ -68,9 +76,10 @@ jobs:
6876
if: steps.check.outputs.new_release == 'true'
6977
env:
7078
GIT_TERMINAL_PROMPT: 0
79+
BRANCH_NAME: ${{ steps.branch.outputs.name }}
7180
run: |
7281
set -e -o pipefail
73-
./utils/kernel-upgrade.sh linux
82+
./utils/kernel-upgrade.sh linux "$BRANCH_NAME"
7483
7584
- name: Create pull request
7685
if: steps.check.outputs.new_release == 'true'
@@ -91,7 +100,7 @@ jobs:
91100
owner: context.repo.owner,
92101
repo: context.repo.repo,
93102
title: `Upgrade to kernel ${{ steps.check.outputs.current_version }}`,
94-
head: 'kernel-upgrade',
103+
head: '${{ steps.branch.outputs.name }}',
95104
base: 'main',
96105
body: `Automated kernel upgrade to version ${{ steps.check.outputs.current_version }}.\n\n**Previous version:** ${{ steps.check.outputs.infix_version }}\n**New version:** ${{ steps.check.outputs.current_version }}\n**Source:** https://www.kernel.org/\n\nThis PR was automatically created by the kernel release monitoring workflow.`
97106
});

utils/kernel-upgrade.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
set -e -o pipefail
1010

1111
# Parse arguments
12-
if [ $# -ne 1 ]; then
13-
echo "Usage: $0 <path-to-linux-dir>"
12+
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
13+
echo "Usage: $0 <path-to-linux-dir> [branch-name]"
1414
exit 1
1515
fi
1616

1717
LINUX_DIR="$1"
18+
INFIX_BRANCH="${2:-kernel-upgrade}"
1819

1920
# Configuration
2021
INFIX_DIR="$(dirname "$(dirname "$(readlink -f "$0")")")"
21-
INFIX_BRANCH="kernel-upgrade"
2222
LINUX_BRANCH="kkit-linux-6.12.y"
2323
UPSTREAM_REMOTE="upstream"
2424
UPSTREAM_URL="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"

0 commit comments

Comments
 (0)