Skip to content

Commit 67b0984

Browse files
authored
ci: ensure filenames don't have undesired characters (#2268)
This should ensure that files are valid across OSs - I've gone with an inclusive pattern which purposely does not have some characters that are technically legal but that I don't think there's a good reason to use them in a filename.
1 parent 983341d commit 67b0984

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/checks.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ jobs:
4242
with:
4343
persist-credentials: false
4444
- run: scripts/report_uncleaned_snapshots.py
45+
filenames:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
persist-credentials: false
51+
- run: |
52+
find . -mindepth 1 ! -regex '.*/[#@A-Za-z0-9._-]*' -print0 \
53+
| xargs -0 -I{} bash -c \
54+
'printf "::error file=%q::This filename contains undesired characters\n" "$1" && false' _ {}
4555
format:
4656
permissions:
4757
contents: read # to fetch code (actions/checkout)

0 commit comments

Comments
 (0)