Skip to content

.github/workflows/pr-if-new-kernel.yml #13

.github/workflows/pr-if-new-kernel.yml

.github/workflows/pr-if-new-kernel.yml #13

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 }}