Refactor AltStore update workflow script

This commit is contained in:
nyne
2025-10-13 21:14:30 +08:00
committed by GitHub
parent c234a53518
commit 8c87c4a906

View File

@@ -31,30 +31,30 @@ jobs:
- name: Update AltStore source - name: Update AltStore source
id: update_source id: update_source
env: env:
GITHUB_TOKEN: ${{ secrets.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
# Create a new branch for the PR # Create a new branch for the PR
branch_name="update-altstore-$(date +%Y%m%d-%H%M%S)" branch_name="update-altstore-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$branch_name" git checkout -b "$branch_name"
git commit -m "Updated source with latest release" git commit -m "Updated source with latest release"
git push -u origin "$branch_name" git push -u origin "$branch_name"
# Create PR using GitHub CLI # Create PR using GitHub CLI
gh pr create \ gh pr create \
--title "Update AltStore source with latest release" \ --title "Update AltStore source with latest release" \
--body "This PR updates the alt_store.json file with the latest release information." \ --body "This PR updates the alt_store.json file with the latest release information." \
--head "$branch_name" \ --head "$branch_name" \
--base main --base main
echo "changes=true" >> $GITHUB_OUTPUT echo "changes=true" >> $GITHUB_OUTPUT
fi fi
- name: Calculate job duration - name: Calculate job duration
id: duration id: duration