Skip to content

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

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

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

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
update:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: 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 "gardenlinux@users.noreply.github.com"
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 gardenlinux/garden-linux-maintainers
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}