Allow black's Github action params overriding. (#1755)
* Allow default params overriding. * Update: docs and action.yaml. * The second contirbution, add my name to authors.md * Correct docs `with.args` example. * Just to rerun the Travis jobs. * chmod 755
This commit is contained in:
parent
f311d82569
commit
4d6a84a829
@ -574,6 +574,7 @@ Multiple contributions by:
|
|||||||
- [Gregory P. Smith](mailto:greg@krypto.org)
|
- [Gregory P. Smith](mailto:greg@krypto.org)
|
||||||
- Gustavo Camargo
|
- Gustavo Camargo
|
||||||
- hauntsaninja
|
- hauntsaninja
|
||||||
|
- [Hadi Alqattan](mailto:alqattanhadizaki@gmail.com)
|
||||||
- [Heaford](mailto:dan@heaford.com)
|
- [Heaford](mailto:dan@heaford.com)
|
||||||
- [Hugo Barrera](mailto::hugo@barrera.io)
|
- [Hugo Barrera](mailto::hugo@barrera.io)
|
||||||
- Hugo van Kemenade
|
- Hugo van Kemenade
|
||||||
|
@ -6,4 +6,4 @@ branding:
|
|||||||
icon: "check-circle"
|
icon: "check-circle"
|
||||||
runs:
|
runs:
|
||||||
using: "docker"
|
using: "docker"
|
||||||
image: "Dockerfile"
|
image: "action/Dockerfile"
|
||||||
|
@ -5,4 +5,6 @@ ENV PYTHONUNBUFFERED 1
|
|||||||
|
|
||||||
RUN pip install --upgrade --no-cache-dir black
|
RUN pip install --upgrade --no-cache-dir black
|
||||||
|
|
||||||
ENTRYPOINT /usr/local/bin/black --check --diff .
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
10
action/entrypoint.sh
Executable file
10
action/entrypoint.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
# Default (if no args provided).
|
||||||
|
sh -c "black . --check --diff"
|
||||||
|
else
|
||||||
|
# Custom args.
|
||||||
|
sh -c "black $*"
|
||||||
|
fi
|
@ -69,6 +69,7 @@ Multiple contributions by:
|
|||||||
- [Gregory P. Smith](mailto:greg@krypto.org)
|
- [Gregory P. Smith](mailto:greg@krypto.org)
|
||||||
- Gustavo Camargo
|
- Gustavo Camargo
|
||||||
- hauntsaninja
|
- hauntsaninja
|
||||||
|
- [Hadi Alqattan](mailto:alqattanhadizaki@gmail.com)
|
||||||
- [Heaford](mailto:dan@heaford.com)
|
- [Heaford](mailto:dan@heaford.com)
|
||||||
- [Hugo Barrera](mailto::hugo@barrera.io)
|
- [Hugo Barrera](mailto::hugo@barrera.io)
|
||||||
- Hugo van Kemenade
|
- Hugo van Kemenade
|
||||||
|
@ -15,5 +15,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
- uses: psf/black@stable
|
- uses: psf/black@stable # the default is equivalent to `black . --diff --check`.
|
||||||
|
with: # (optional - override the default parameters).
|
||||||
|
args: ". --diff --check"
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user