Skip to content

Commit

Permalink
Auto update for PI
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Nov 15, 2024
1 parent 62f75b3 commit b740122
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/pif.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check & Update

permissions:
contents: write

on:
workflow_dispatch:
schedule:
- cron: '27 3 * * *'

jobs:
update:
if: github.repository_owner == 'Flamefire'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install tool
run: sudo apt-get -o Acquire::Retries=5 install -y apktool

- name: Update PIF
run: |
bash tools/autopif.sh
if git diff --exit-code tools/pif.json; then
echo "updated=no" >> $GITHUB_ENV
else
echo "updated=yes" >> $GITHUB_ENV
fi
- name: Commit new file
if: env.updated == 'yes'
run: |
git config --global user.email "[email protected]"
git config --global user.name "Alexander Grund"
git add tools/pif.json
msg="Update PIF"
if [[ "$(git show --format="%s" --no-patch)" == "$msg" ]]; then
git commit --amend
else
git commit -m "$msg"
fi
git push --force-with-lease
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
tools/XiaomiEUModule*
tools/pif.json

Empty file added tools/pif.json
Empty file.

0 comments on commit b740122

Please sign in to comment.