-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add workflow validation to fix windows colon errors (#520)
* chore: add workflow validation to fix windows colon errors * chore: also add commits * fix: use checkout * chore: tested and worked fixing file
- Loading branch information
1 parent
e8b9776
commit 0ae5638
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Check Filenames on PR and Commits | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
check-filenames: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check for invalid filenames | ||
run: | | ||
if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
invalid_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep ":" || true) | ||
else | ||
invalid_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep ":" || true) | ||
if [ -z "$invalid_files" ]; then | ||
# Also check all files in the current commit | ||
invalid_files=$(git ls-files | grep ":" || true) | ||
fi | ||
fi | ||
if [ ! -z "$invalid_files" ]; then | ||
echo "Error: The following files contain ':' in their names, which is not compatible with Windows:" | ||
echo "$invalid_files" | ||
exit 1 | ||
fi |
File renamed without changes.