Skip to content

Commit 88aa9b9

Browse files
Merge pull request #8 from ingomueller-net/working-dir
feat: cd to workspace folder before executing yapf
2 parents c1a25f7 + a786fe7 commit 88aa9b9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ jobs:
3030

3131
You can pass any other [YAPF parameter](https://github.com/google/yapf#usage) using the `args` setting, e.g. for setting a different code style (default is PEP8), but you can also remove the `with` section entirely if you wish.
3232

33-
If you want to exclude a certain directory, you can use the args field like this: `args: --verbose --exclude '**/tests/**'`. Thank you [@pksol](https://github.com/pksol) for the [example](https://github.com/AlexanderMelde/yapf-action/issues/1).
33+
If you want to exclude a certain file or directory, you can either use the `--exclude` parameter or a `.yapfignore` file.
34+
35+
### Migration Notice
36+
Earlier versions of this action did not set the working directory before executing `yapf`.
37+
38+
If you used the `--exclude '**/tests/**'` workaround, you might need to simplify this to `--exclude 'tests/**'` now.

entrypoint.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh
22
set -e
33
echo "Checking formatting for $GITHUB_REPOSITORY"
4-
sh -c "yapf --diff --recursive $GITHUB_WORKSPACE $*"
4+
cd "$GITHUB_WORKSPACE"
5+
sh -c "yapf --diff --recursive . $*"

0 commit comments

Comments
 (0)