Skip to content

Commit 970f072

Browse files
committed
fix(workflow): add xargs to handle file names with spaces in markdown update workflow
1 parent 1dff466 commit 970f072

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/on-markdown-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
# Loop through each file mask and check for changes
3939
for mask in ${{ env.file_masks }}; do
4040
# Get the list of changed files for the current mask
41-
current_changed_files=$(git diff --name-status ${{ github.event.before }} ${{ github.event.after }} | grep '^[AM]' | grep "${mask}" | awk '{print $2}')
41+
current_changed_files=$(git diff --name-status ${{ github.event.before }} ${{ github.event.after }} | grep '^[AM]' | grep "${mask}" | awk '{print $2}' | xargs)
4242
# Get the list of deleted files for the current mask
43-
current_deleted_files=$(git diff --name-status ${{ github.event.before }} ${{ github.event.after }} | grep '^D' | grep "${mask}" | awk '{print $2}')
43+
current_deleted_files=$(git diff --name-status ${{ github.event.before }} ${{ github.event.after }} | grep '^D' | grep "${mask}" | awk '{print $2}' | xargs)
4444
# Check if there are any changes for the current mask
4545
current_any_changed=$(git diff --name-status ${{ github.event.before }} ${{ github.event.after }} | grep "${mask}" | wc -l)
4646

0 commit comments

Comments
 (0)