-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (35 loc) · 1.23 KB
/
pr-if-new-kernel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
update:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
actions: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: |
OUTPUT=$(python update-kernel.py)
echo $OUTPUT
echo "has-update=$OUTPUT" >> "$GITHUB_OUTPUT"
id: update
- name: create pull request
run: |
if [[ '${{ steps.update.outputs.has-update }}' ]]; then
git checkout -b update-kernel
git add prepare_source
git config --global user.name "Garden Linux Builder"
git config --global user.email "[email protected]"
git commit -am 'Update kernel ${{ steps.update.outputs.has-update }}'
git push --set-upstream origin update-kernel
gh pr create --base main --head update-kernel --title 'Update kernel ${{ steps.update.outputs.has-update }}' --body "automated update" --reviewer fwilhe
gh workflow run "build.yml" --ref "update-kernel"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}