From 17a8c4b79634e21010b33b0898f340fe60a6d840 Mon Sep 17 00:00:00 2001 From: Dominique Luna Date: Sat, 7 Sep 2019 15:42:46 -0400 Subject: [PATCH] wip --- Dockerfile | 18 ++++++++++++++++++ README.md | 25 +++++++++++++++++++++++-- entrypoint.sh | 5 +++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2937c86 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM julia:latest + +LABEL "com.github.actions.name" = "JuliaFormatter" +LABEL "com.github.actions.description" = "Format Julia code using JuliaFormatter.jl" +LABEL "com.github.actions.icon" = "code" +LABEL "com.github.actions.color" = "yellow" + +LABEL "repository"="https://github.com/domluna/action-JuliaFormatter" +LABEL "homepage"="https://github.com/domluna/action-JuliaFormatter" +LABEL "maintainer"="Dominique Luna " + +RUN julia -e 'using Pkg; Pkg.add("JuliaFormatter"); using JuliaFormatter' + +ENV PATH="$HOME/.julia/dev/JuliaFormatter.jl/bin:$PATH" + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index 140c615..46bc3e8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,23 @@ -# action-JuliaFormatter -Github action for JuliaFormatter.jl +# Github Action For JuliaFormatter.jl + +Github action that runs [JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl) on your `.jl` files. + +## Example + +This will recursively format all `.jl` files your repository with default indentation width and maximum line margin. +`-v` toggles verbose output. + +See the help message in [this file](https://github.com/domluna/JuliaFormatter.jl/blob/master/bin/format.jl) for detailed description of flags/arguments. + +```workflow +workflow "Example Workflow" { + on = "push" + resolves = ["Format"] +} + +action "Format" { + uses = "domluna/action-JuliaFormatter@master" + args = "-v ." +} +``` + diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..1a8b53d --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +sh -c "format.jl $*"