From 0cda9a2921ba97d732891da1c16172c18b61ee03 Mon Sep 17 00:00:00 2001 From: nyne Date: Sun, 12 Oct 2025 19:57:28 +0800 Subject: [PATCH] Fix alt_store workflow --- .github/workflows/update_alt_store.yml | 35 +++++++++++++++++--------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/update_alt_store.yml b/.github/workflows/update_alt_store.yml index c42a5cf..d896199 100644 --- a/.github/workflows/update_alt_store.yml +++ b/.github/workflows/update_alt_store.yml @@ -31,19 +31,30 @@ jobs: - name: Update AltStore source id: update_source env: - GITHUB_TOKEN: ${{ secrets.ACTION_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - python update_alt_store.py - git config --global user.name 'GitHub Action' - git config --global user.email 'action@github.com' - git add alt_store.json - if git diff --staged --quiet; then - echo "changes=false" >> $GITHUB_OUTPUT - else - git commit -m "Updated source with latest release" - git push - echo "changes=true" >> $GITHUB_OUTPUT - fi + python update_alt_store.py + git config --global user.name 'GitHub Action' + git config --global user.email 'action@github.com' + git add alt_store.json + if git diff --staged --quiet; then + echo "changes=false" >> $GITHUB_OUTPUT + else + # Create a new branch for the PR + branch_name="update-altstore-$(date +%Y%m%d-%H%M%S)" + git checkout -b "$branch_name" + git commit -m "Updated source with latest release" + git push -u origin "$branch_name" + + # Create PR using GitHub CLI + gh pr create \ + --title "Update AltStore source with latest release" \ + --body "This PR updates the alt_store.json file with the latest release information." \ + --head "$branch_name" \ + --base main + + echo "changes=true" >> $GITHUB_OUTPUT + fi - name: Calculate job duration id: duration