Skip to content

Update Ubuntu RootFS #373

Update Ubuntu RootFS

Update Ubuntu RootFS #373

Workflow file for this run

name: Update Ubuntu RootFS
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
echo "::notice::Installing Python dependencies..."
pip install requests
- name: Run update script
run: |
echo "::notice::Running RootFS update script..."
python scripts/update_rootfs.py
- name: Read updated version
id: version
run: |
echo "::notice::Reading rootfs version from install-ubuntu.sh..."
version=$(grep -oP '^(name|code_name|release)=\K[^"]+' install-ubuntu.sh | sed -E ':a;N;$!ba;s/\s|\n/-/g')
echo "version=$version" >> $GITHUB_ENV
echo "::notice::RootFS Version = '$version'"
- name: Check for changes
run: |
echo "::notice::Checking for changes..."
if git diff --quiet; then
echo "::notice::No changes to commit. Exiting..."
exit 0
fi
echo "::notice::Changes found! Preparing for pull request..."
echo "branch=auto-rootfs-update-${{ env.version }}" >> $GITHUB_ENV
echo "create_pull_request=true" >> $GITHUB_ENV
echo "::notice::Branch name: ${{ env.branch }}"
echo "::notice::Create pull request: ${{ env.create_pull_request }}"
- name: Create Pull Request
if: env.create_pull_request == 'true'
uses: peter-evans/create-pull-request@v7
with:
title: RootFS auto-update to ${{ env.version }}
commit-message: Updated RootFS to version ${{ env.version }}
body: The RootFS has been automatically updated to ${{ env.version }} by github workflow [update_rootfs.yml](https://github.com/jorexdeveloper/termux-ubuntu/blob/main/.github/workflows/update_rootfs.yml).
branch: ${{ env.branch }}
labels: automated,update
delete-branch: true