diff --git a/.github/workflows/cron-weekly-rustfmt.yml b/.github/workflows/cron-weekly-rustfmt.yml index ba1152104..046ba8fe3 100644 --- a/.github/workflows/cron-weekly-rustfmt.yml +++ b/.github/workflows/cron-weekly-rustfmt.yml @@ -14,7 +14,7 @@ jobs: components: rustfmt - name: Run Nightly rustfmt # Run the formatter and manually remove trailing whitespace. - run: cargo +nightly fmt && find . -type f -name '*.rs' -exec sed -i 's/ $//' {} \; + run: cargo +nightly fmt && git ls-files -- '*.rs' -z | xargs sed -E -i'' -e 's/[[:space:]]+$//' - name: Get the current date run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: Create Pull Request