Skip to content

Commit da69824

Browse files
committed
Fix CI rebase: stash everything before pull, pop with --index
git pull --rebase refuses to run with either staged OR unstaged changes. --keep-index only stashed the unstaged side, leaving staged changes in the index which caused 'Your index contains uncommitted changes'. Switch to plain git stash (stashes everything) so the tree is fully clean for the rebase, then git stash pop --index to restore both the working tree changes and the staged index state.
1 parent e3cae4d commit da69824

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/rebuild_on_module_tools_change.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,16 @@ jobs:
4949
# Stage files we want to commit
5050
git add ../docs/software/apps_md ../docs/software/app_catalog.md ../docs/software/index.md apps_descriptions.json ../docs/software/ngc_md ../docs/software/ngc_catalog.md ../docs/software/rocm_md ../docs/software/rocm_catalog.md || true
5151
52-
# Stash remaining unstaged changes (make generates many files we don't commit)
53-
# --keep-index leaves the staged files untouched
54-
git stash --keep-index || true
52+
# Stash everything (staged + unstaged) so rebase sees a fully clean tree
53+
git stash || true
5554
56-
# Pull and rebase cleanly now that working tree is clean
55+
# Pull and rebase cleanly
5756
git pull origin ${{ github.ref_name }} --rebase
5857
59-
# Restore stashed files (not committed, just put back for cleanliness)
60-
git stash pop || true
58+
# Restore stash and reinstate the index (staged) state
59+
git stash pop --index || true
6160
62-
# Re-stage in case rebase touched our files
61+
# Re-stage as a safety net in case pop --index couldn't restore the index
6362
git add ../docs/software/apps_md ../docs/software/app_catalog.md ../docs/software/index.md apps_descriptions.json ../docs/software/ngc_md ../docs/software/ngc_catalog.md ../docs/software/rocm_md ../docs/software/rocm_catalog.md || true
6463
6564
git diff --cached --quiet && echo "No changes to commit" && exit 0

0 commit comments

Comments
 (0)