From 976e6a9eea2772868ef96bb35acafc03a12c1562 Mon Sep 17 00:00:00 2001 From: Balackburn <93828569+Balackburn@users.noreply.github.com> Date: Fri, 7 Jul 2023 17:51:55 +0200 Subject: [PATCH] testing --- .github/workflows/update_source.yml | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/update_source.yml diff --git a/.github/workflows/update_source.yml b/.github/workflows/update_source.yml new file mode 100644 index 0000000..ba41977 --- /dev/null +++ b/.github/workflows/update_source.yml @@ -0,0 +1,52 @@ +name: Update apps.json everyday + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + repository_dispatch: + types: [update-altstore-source-trigger] + +jobs: + update_json: + runs-on: ubuntu-latest + + steps: + - name: Delay for repository_dispatch event + if: github.event_name == 'repository_dispatch' + run: | + echo "Waiting for 8 minutes..." + sleep 480 # 8 minutes x 60 seconds + + - name: Check out repository + uses: actions/checkout@v2 + with: + ref: gh-pages + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests + + - name: Run script + run: | + python Altstore/scripts/update_json.py + + - name: Check for changes + id: check_changes + run: | + git diff --exit-code || echo "::set-output name=has_changes::true" + + - name: Commit and push changes + if: steps.check_changes.outputs.has_changes == 'true' + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git add . + git commit -m "Update JSON file with latest release" + git push \ No newline at end of file