Skip to content

Commit

Permalink
fix: general
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Nov 23, 2024
1 parent 9fb7000 commit e73007f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/sync-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,28 +91,29 @@ jobs:
cp -f "template-repo/$file" "$file"
file_list+=$'\n'"- \`${file}\`"
else
echo "Removing file/directory: $file"
echo "Removing missing file or directory: $file"
rm -rf "$file"
file_list+=$'\n'"- \`${file}\` (removed)"
fi
done
# Add all changes
git add .
# Check for blacklisted files and revert changes
echo "Checking for blacklisted files..."
for blacklisted in "${blacklist_files[@]}"; do
if [[ -e "$blacklisted" ]]; then
echo "Reverting blacklisted file or directory: $blacklisted"
git restore "$blacklisted" || rm -rf "$blacklisted"
git rm -rf --cached "$blacklisted" || rm -rf "$blacklisted"
fi
done
# Commit
# Clean up
rm -rf template-repo/
# Commit changes
git add .
git commit -m "chore: sync template" || echo "No changes to commit."
# Push
# Push changes to the remote repository
git push "$original_remote" "$pr_branch"
# Check for existing pull requests
Expand All @@ -123,4 +124,4 @@ jobs:
else
gh pr edit "$existing_pr" --body "This pull request merges changes from the template repository, overwriting or removing the following files:${file_list}"
echo "Updated the existing pull request #$existing_pr."
fi
fi

0 comments on commit e73007f

Please sign in to comment.