Skip to content

Commit 1279b3f

Browse files
Remove workflow files from merge commit before pushing
- Use git rm --cached to remove workflow files from merge index - Restore workflow files to pre-merge state - Prevents workflow files from being included in the push
1 parent 000b274 commit 1279b3f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/refresh_repository.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,15 @@ jobs:
7878
# Merge upstream changes
7979
git merge --no-edit upstream/master || true
8080
81-
# Always restore workflow files to pre-merge version (exclude from merge)
82-
echo "Excluding workflow files from merge - restoring to current version"
83-
git checkout $CURRENT_COMMIT -- .github/workflows/ || true
81+
# Remove workflow files from the merge completely
82+
echo "Excluding workflow files from merge - removing from index"
83+
git rm --cached -r .github/workflows/ 2>/dev/null || true
8484
85-
# Stage the restored workflow files and complete the merge
86-
git add .github/workflows/ || true
85+
# Restore workflow files to pre-merge version from working directory
86+
echo "Restoring workflow files to current version"
87+
git checkout $CURRENT_COMMIT -- .github/workflows/ || true
8788
88-
# Complete the merge with the restored workflow files
89+
# Complete the merge without workflow files
8990
if [[ -f .git/MERGE_HEAD ]]; then
9091
git commit --no-edit || true
9192
fi

0 commit comments

Comments
 (0)