Skip to content

fix: Add simple corrections to the WSL2 article #337

fix: Add simple corrections to the WSL2 article

fix: Add simple corrections to the WSL2 article #337

name: Check filenames for spaces
on:
pull_request:
branches: [main]
jobs:
check-filenames-spaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history to ensure we can access all branches
- name: Check filenames for spaces
id: list-files
run: |
# Get the list of added files from the pull request
FILENAMES_SPACES=$(git diff --name-only origin/main...HEAD | ( grep "\s" || true ) )
if [ -n "$FILENAMES_SPACES" ]; then
echo "Rejecting merge. PR has the following files with spaces in their names:"
echo "$FILENAMES_SPACES"
echo "Please replace the spaces, for example, with a dash."
exit 1
else
echo "All added files have no spaces."
fi