Unverified Commit 4d6a84a8 authored by Hadi Alqattan's avatar Hadi Alqattan Committed by GitHub
Browse files

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
parent f311d825
Loading
Loading
Loading
Loading
+1 −0
Changes for README.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -574,6 +574,7 @@ Multiple contributions by:
- [Gregory P. Smith](mailto:greg@krypto.org)
- Gustavo Camargo
- hauntsaninja
- [Hadi Alqattan](mailto:alqattanhadizaki@gmail.com)
- [Heaford](mailto:dan@heaford.com)
- [Hugo Barrera](mailto::hugo@barrera.io)
- Hugo van Kemenade
+1 −1
Changes for action.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -6,4 +6,4 @@ branding:
  icon: "check-circle"
runs:
  using: "docker"
  image: "Dockerfile"
  image: "action/Dockerfile"
+3 −1
Changes for action/Dockerfile: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -5,4 +5,6 @@ ENV PYTHONUNBUFFERED 1

RUN pip install --upgrade --no-cache-dir black

ENTRYPOINT /usr/local/bin/black --check --diff  .
COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

action/entrypoint.sh

0 → 100755
+10 −0
Changes for action/entrypoint.sh: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/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
+1 −0
Changes for docs/authors.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ Multiple contributions by:
- [Gregory P. Smith](mailto:greg@krypto.org)
- Gustavo Camargo
- hauntsaninja
- [Hadi Alqattan](mailto:alqattanhadizaki@gmail.com)
- [Heaford](mailto:dan@heaford.com)
- [Hugo Barrera](mailto::hugo@barrera.io)
- Hugo van Kemenade
Loading