From f30f733c735b33a8f339b5364c53c32dbd43da1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1z=20Zengin?= Date: Mon, 24 Nov 2025 19:09:25 +0300 Subject: [PATCH] git: add workflow for auto mirroring git.yzbruh.space/YZBruh/pmt-renovated. --- .github/workflows/fetch-changes.yml | 25 +++++++++++++++++++++++++ manager.sh | 21 +++++++-------------- 2 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/fetch-changes.yml diff --git a/.github/workflows/fetch-changes.yml b/.github/workflows/fetch-changes.yml new file mode 100644 index 0000000..79d048f --- /dev/null +++ b/.github/workflows/fetch-changes.yml @@ -0,0 +1,25 @@ +name: Mirror External Repo to GitHub + +on: + schedule: + - cron: '0 * * * *' + workflow_dispatch: + +jobs: + mirror: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Mirror external repo + run: | + git config --global user.name "github-actions" + git config --global user.email "actions@github.com" + git clone --mirror https://git.yzbruh.space/YZBruh/pmt-renovated.git temp-mirror + cd temp-mirror + git remote add github https://github.com/ShawkTeam/pmt-renovated.git + git push --mirror github diff --git a/manager.sh b/manager.sh index ae69447..ca378bd 100644 --- a/manager.sh +++ b/manager.sh @@ -19,8 +19,7 @@ RELEASE="20250821" echo() { command echo "[$THIS]: $@"; } -checks() -{ +checks() { if ! curl "https://github.com" &>/dev/null; then echo "No internet connection!" exit 1 @@ -32,8 +31,7 @@ checks() [ ! -f $PREFIX/bin/wget ] && pkg install -y wget } -select_variant() -{ +select_variant() { LINK=""; ARCH=""; VARIANT="" if getprop ro.product.cpu.abi | grep "arm64-v8a" &>/dev/null; then ARCH="arm64-v8a" @@ -44,8 +42,7 @@ select_variant() LINK="https://github.com/ShawkTeam/pmt-renovated/releases/download/${RELEASE}/pmt-${VARIANT}${ARCH}.zip" } -download() -{ +download() { echo "Downloading pmt-${VARIANT}${ARCH}.zip (${RELEASE})" if ! wget -O $PREFIX/tmp/pmt.zip "${LINK}" &>/dev/null; then echo "Download failed! LINK=${LINK}" @@ -60,8 +57,7 @@ download() fi } -setup() -{ +setup() { [ -f $PREFIX/tmp/pmt_static ] && mv $PREFIX/tmp/pmt_static $PREFIX/tmp/pmt set -e install -t $PREFIX/bin $PREFIX/tmp/pmt @@ -72,21 +68,18 @@ setup() echo "Installed successfully. Try running 'pmt' command." } -uninstall() -{ +uninstall() { rm -f $PREFIX/bin/pmt $PREFIX/lib/libhelper* $PREFIX/lib/libpartition_map* &>/dev/null } -is_installed() -{ +is_installed() { if /system/bin/which pmt &>/dev/null; then echo "PMT is already installed." exit 1 fi } -cleanup() -{ +cleanup() { rm -f $PREFIX/tmp/pmt* $PREFIX/tmp/lib* $PREFIX/tmp/*.zip &>/dev/null }