]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Allow black's Github action params overriding. (#1755)
authorHadi Alqattan <alqattanhadizaki@gmail.com>
Sun, 18 Oct 2020 21:24:33 +0000 (00:24 +0300)
committerGitHub <noreply@github.com>
Sun, 18 Oct 2020 21:24:33 +0000 (14:24 -0700)
* 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

README.md
action.yml
action/Dockerfile [moved from Dockerfile with 64% similarity]
action/entrypoint.sh [new file with mode: 0755]
docs/authors.md
docs/github_actions.md

index 2ca76dd6415d96105d3a05616e5d3ff14da3da11..7cd4d7f13b20f870dea9e8d1a1bd9506f1d9cc40 100644 (file)
--- a/README.md
+++ b/README.md
@@ -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
index 2ce1c0bf2ef7437051350cbc2ab7d75f78b805ca..60bf369a3d812192ef023c0cdb7b1c45d8af6d18 100644 (file)
@@ -6,4 +6,4 @@ branding:
   icon: "check-circle"
 runs:
   using: "docker"
-  image: "Dockerfile"
+  image: "action/Dockerfile"
similarity index 64%
rename from Dockerfile
rename to action/Dockerfile
index a03d23a10782f09ea291c3a67880a758a5bef692..eb2209940db0f40279e25d0d1f65784177cf006d 100644 (file)
@@ -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"]
diff --git a/action/entrypoint.sh b/action/entrypoint.sh
new file mode 100755 (executable)
index 0000000..dc86fa1
--- /dev/null
@@ -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
index a5349b4b9df74dd957706b4299f38e7012ba584f..ebf64eaae76dfe566f9853ee58fc306323c093dd 100644 (file)
@@ -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
index 7ff875402421de62643f1e53dc9c467df9e6aa55..ac80c2fab6f831688a88282fda221095e3c875ab 100644 (file)
@@ -15,5 +15,7 @@ jobs:
     steps:
       - uses: actions/checkout@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"
 ```