File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 40
40
- name : Commit to the PR branch if any changes
41
41
run : |
42
42
make format
43
- find . -type f -not -path '*/\. git/*' -exec grep -Iq . {} \; -exec dos2unix {} \;
44
- find . -type f -not -path '*/\. git/*' -exec grep -Iq . {} \; -exec chmod 644 {} \;
43
+ git ls-files -z | xargs -0 dos2unix --quiet
44
+ git ls-files -z | xargs -0 chmod 644
45
45
if [[ $(git ls-files -m) ]]; then
46
46
git config --global user.name 'actions-bot'
47
47
git config --global user.email '[email protected] '
Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ jobs:
43
43
44
44
- name : Ensure files use UNIX line breaks and have 644 permission
45
45
run : |
46
- find . -type f -not -path '*/\. git/*' -exec grep -Iq . {} \; -exec dos2unix --quiet {} \;
47
- find . -type f -not -path '*/\. git/*' -exec grep -Iq . {} \; -exec chmod 644 {} \;
46
+ git ls-files -z | xargs -0 dos2unix --quiet
47
+ git ls-files -z | xargs -0 chmod 644
48
48
if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi
49
49
50
50
- name : Ensure example scripts have at least one code block separator
51
51
run : |
52
- grep --files-without-match '# %%' $(find 'examples' -name '*.py') > output.txt
52
+ git ls-files 'examples/**/*.py' | xargs grep --files-without-match '# %%' > output.txt
53
53
nfiles=$(wc --lines output.txt | awk '{print $1}')
54
54
if [[ $nfiles > 0 ]]; then
55
55
echo "Code block separator '# %%' is required in following example files:"
You can’t perform that action at this time.
0 commit comments