From 35a1090fe29872ddcd810f93e242f6df1b462151 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Fri, 1 Feb 2019 15:15:14 -0800 Subject: [PATCH 1/5] fix: wrap "/entrypoint.js" in brackets --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dec4007..50e7fe8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,4 @@ COPY . / WORKDIR / RUN ["npm", "install", "--production"] -ENTRYPOINT "/entrypoint.js" +ENTRYPOINT ["/entrypoint.js"] From 94609da0162b2ed5f5e57727483099e487416204 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Fri, 1 Feb 2019 15:37:55 -0800 Subject: [PATCH 2/5] test args in workflow --- .github/main.workflow | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/main.workflow b/.github/main.workflow index f3e5867..3d6433a 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -23,6 +23,7 @@ action "test" { action "deploy" { needs = ["test"] uses = "./" + args = "--help" secrets = [ "GITHUB_TOKEN", "NOW_TOKEN", From 162d5e0495f9a85acdac06a4ac1863bcdde963b3 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Fri, 1 Feb 2019 16:03:55 -0800 Subject: [PATCH 3/5] docs: update Now CLI args section --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c781462..aa06985 100644 --- a/README.md +++ b/README.md @@ -39,20 +39,23 @@ action "deploy" { To avoid racking up failed deployments, we suggest that you place this action after any linting and test actions. ## Now CLI arguments -It's possible to pass additional arguments through to the `now` CLI by passing them after a `--` in the positional arguments to the entrypoint (or, if you're running this from an npm installation, the `primer-deploy` CLI). However, due to a known issue with the `args` field in workflow files, you have to use `runs` like so: +It's possible to pass additional arguments through to the `now` CLI via the `args` field in your workflow action. Because the `primer-deploy` CLI accepts options of its own (such as `--dry-run`), you need to prefix any `now` arguments with `--`: ```diff action "deploy" { uses = "primer/deploy@master" -- args = "-- --meta foo=bar" -+ runs = "/entrypoint.js -- --meta foo=bar" - secrets = [ - "GITHUB_TOKEN", - "NOW_TOKEN", - ] -} ++ args = "-- --meta foo=bar" +``` + +You can also use `args` to deploy a subdirectory, e.g. `docs`: + +```diff +action "deploy" { + uses = "primer/deploy@master" ++ args = "-- docs" ``` + [now]: https://zeit.co/now [github actions]: https://github.com/features/actions [commit status]: https://developer.github.com/v3/repos/statuses/ From 794b4d1f43ecfb068765660577e6f8bf91c3b78b Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Fri, 1 Feb 2019 16:04:23 -0800 Subject: [PATCH 4/5] chore: nix args: "--help" from workflow --- .github/main.workflow | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/main.workflow b/.github/main.workflow index 3d6433a..f3e5867 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -23,7 +23,6 @@ action "test" { action "deploy" { needs = ["test"] uses = "./" - args = "--help" secrets = [ "GITHUB_TOKEN", "NOW_TOKEN", From 5f111b26276d2f60a0308b7758a93218e474139d Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 5 Feb 2019 13:31:54 -0800 Subject: [PATCH 5/5] docs: make --meta args example more interesting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa06985..73d63ae 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ It's possible to pass additional arguments through to the `now` CLI via the `arg ```diff action "deploy" { uses = "primer/deploy@master" -+ args = "-- --meta foo=bar" ++ args = "-- --meta autoDeployed=true" ``` You can also use `args` to deploy a subdirectory, e.g. `docs`: