Fix alt_store workflow

This commit is contained in:
2025-10-12 19:57:28 +08:00
parent 0eb5d76687
commit 0cda9a2921

View File

@@ -31,19 +31,30 @@ jobs:
- name: Update AltStore source - name: Update AltStore source
id: update_source id: update_source
env: env:
GITHUB_TOKEN: ${{ secrets.ACTION_GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
python update_alt_store.py python update_alt_store.py
git config --global user.name 'GitHub Action' git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com' git config --global user.email 'action@github.com'
git add alt_store.json git add alt_store.json
if git diff --staged --quiet; then if git diff --staged --quiet; then
echo "changes=false" >> $GITHUB_OUTPUT echo "changes=false" >> $GITHUB_OUTPUT
else else
git commit -m "Updated source with latest release" # Create a new branch for the PR
git push branch_name="update-altstore-$(date +%Y%m%d-%H%M%S)"
echo "changes=true" >> $GITHUB_OUTPUT git checkout -b "$branch_name"
fi 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 - name: Calculate job duration
id: duration id: duration