mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 22:35:42 +00:00
Add stale PR refs cleanup to iOS CI workflows (#5832)
* Add stale PR refs cleanup to iOS CI workflows Self-hosted runners persist .git between runs. When a PR is updated, old local refs may point to commits that were never fetched, causing "Could not scan for Git LFS files" errors. Applied to: - ios_addressables_build.yml - ios_testflight.yml (Same fix already present in mac_build.yml and unity_build.yml) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fetch LFS after checkout to avoid stale ref issues Move LFS fetching out of actions/checkout and into a separate step. This ensures our stale PR refs cleanup runs before any LFS operations, avoiding "Could not scan for Git LFS files" errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix LFS fetch order in mac_build and unity_build workflows Apply the same fix as ios_* workflows: set lfs: false in checkout and fetch LFS files manually afterward to avoid stale ref issues. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,13 +32,26 @@ jobs:
|
||||
runs-on: [self-hosted, macOS, unity-mac]
|
||||
|
||||
steps:
|
||||
- name: Prune stale PR refs
|
||||
run: |
|
||||
# Self-hosted runners persist .git between runs. When a PR is updated,
|
||||
# old local refs (refs/remotes/pull/*/merge) may point to commits whose
|
||||
# objects were never fetched or have been pruned. Remove these stale refs
|
||||
# before checkout to prevent "missing object" errors.
|
||||
if [ -d ".git" ]; then
|
||||
echo "Pruning stale PR refs..."
|
||||
git for-each-ref --format='%(refname)' refs/remotes/pull/ 2>/dev/null | \
|
||||
xargs -r git update-ref -d 2>/dev/null || true
|
||||
fi
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
lfs: false # Fetch LFS after checkout to avoid stale ref issues
|
||||
clean: true
|
||||
|
||||
- name: Pull LFS files
|
||||
run: git lfs pull
|
||||
- name: Fetch LFS files
|
||||
run: |
|
||||
git lfs install
|
||||
git lfs pull
|
||||
|
||||
- name: Ensure Unity version installed
|
||||
run: ./ci/github_actions/ensure_unity_installed.sh ios
|
||||
|
||||
@@ -26,14 +26,27 @@ jobs:
|
||||
xcode_project_path: ${{ steps.build.outputs.xcode_project_path }}
|
||||
|
||||
steps:
|
||||
- name: Prune stale PR refs
|
||||
run: |
|
||||
# Self-hosted runners persist .git between runs. When a PR is updated,
|
||||
# old local refs (refs/remotes/pull/*/merge) may point to commits whose
|
||||
# objects were never fetched or have been pruned. Remove these stale refs
|
||||
# before checkout to prevent "missing object" errors.
|
||||
if [ -d ".git" ]; then
|
||||
echo "Pruning stale PR refs..."
|
||||
git for-each-ref --format='%(refname)' refs/remotes/pull/ 2>/dev/null | \
|
||||
xargs -r git update-ref -d 2>/dev/null || true
|
||||
fi
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
lfs: false # Fetch LFS after checkout to avoid stale ref issues
|
||||
clean: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Pull LFS files
|
||||
run: git lfs pull
|
||||
- name: Fetch LFS files
|
||||
run: |
|
||||
git lfs install
|
||||
git lfs pull
|
||||
|
||||
- name: Ensure Unity version installed
|
||||
run: ./ci/github_actions/ensure_unity_installed.sh ios
|
||||
|
||||
@@ -84,12 +84,14 @@ jobs:
|
||||
fi
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
lfs: false # Fetch LFS after checkout to avoid stale ref issues
|
||||
clean: true # Remove untracked files like old SparklePlugin.bundle
|
||||
fetch-depth: 0 # For version numbering from git history
|
||||
|
||||
- name: Pull LFS files
|
||||
run: git lfs pull
|
||||
- name: Fetch LFS files
|
||||
run: |
|
||||
git lfs install
|
||||
git lfs pull
|
||||
|
||||
- name: Ensure Unity version installed
|
||||
run: ./ci/github_actions/ensure_unity_installed.sh mac
|
||||
|
||||
@@ -69,10 +69,13 @@ jobs:
|
||||
fi
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
lfs: false # Fetch LFS after checkout to avoid stale ref issues
|
||||
clean: true # Remove untracked files from previous builds
|
||||
- name: Pull lfs files
|
||||
run: git lfs pull
|
||||
|
||||
- name: Fetch LFS files
|
||||
run: |
|
||||
git lfs install
|
||||
git lfs pull
|
||||
- name: Ensure Unity version installed
|
||||
run: ./ci/github_actions/ensure_unity_installed.sh windows
|
||||
- name: Restore Library/
|
||||
|
||||
Reference in New Issue
Block a user