From 48506f811185ca0c4db5092aa363c94aa92ee724 Mon Sep 17 00:00:00 2001 From: Yuncheng Date: Sun, 5 Feb 2023 23:21:55 +1100 Subject: [PATCH 1/3] improved readme file --- README.md | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab30dda..9a6aef7 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ The `stackql/setup-stackql` action is a JavaScript action that sets up StackQL C This action can be run on `ubuntu-latest`, `windows-latest`, and `macos-latest` GitHub Actions runners, and will install and expose the latest version of the `stackql` CLI on the runner environment. -# Auth +# Usage [Learn more](https://stackql.io/docs/getting-started/authenticating) about authentication setup when running stackql -### Basic Example +## Basic Example 1. Set Auth variable, for example: ``` { "github": { "type": "basic", "credentialsenvvar": "STACKQL_GITHUB_CREDS" } } @@ -21,8 +21,17 @@ This action can be run on `ubuntu-latest`, `windows-latest`, and `macos-latest` 3. In the execution step, pass the secret as environment variable with name "STACKQL_GITHUB_CREDS" Check the "Use GitHub Provider" step in `.github/workflows/setup-stackql.yml` for the working example +### Example +``` + - name: Use GitHub Provider + run: | + stackql exec -i ./examples/github-example.iql --auth='{ "github": { "type": "basic", "credentialsenvvar": "STACKQL_GITHUB_CREDS" } }' + env: + STACKQL_GITHUB_CREDS: ${{ secrets.STACKQL_GITHUB_CREDS }} +``` + -### json File Auth example +## json File Auth example 1. Set Auth variable, for example: ``` @@ -31,4 +40,28 @@ Check the "Use GitHub Provider" step in `.github/workflows/setup-stackql.yml` fo 2. encode the key json file into base64 string 3. in execution step, run `sudo echo ${{ secrets. }} | base64 -d > sa-key.json` -Check the "Prep Google Creds" step in `.github/workflows/setup-stackql.yml` for the working example \ No newline at end of file +Check the "Prep Google Creds" step in `.github/workflows/setup-stackql.yml` for the working example +### Example +``` + - name: Prep Google Creds (bash) + if: ${{ matrix.os != 'windows-latest' }} + run: | ## use the secret to create json file + sudo echo ${{ secrets.GOOGLE_CREDS }} | base64 -d > sa-key.json + + - name: Use Google Provider + run: | + stackql exec -i ./examples/google-example.iql --auth='{ "google": { "type": "service_account", "credentialsfilepath": "sa-key.json" }}' +``` + +## Input +- `use_wrapper` - (optional) Whether to install a wrapper to wrap subsequent calls of + the `stackql` binary and expose its STDOUT, STDERR, and exit code as outputs + named `stdout`, `stderr`, and `exitcode` respectively. Defaults to `false`. + +## Outputs +This action does not configure any outputs directly. However, when you set the `use_wrapper` input +to `true`, the following outputs are available for subsequent steps that call the `stackql` binary: + +- `stdout` - The STDOUT stream of the call to the `stackql` binary. +- `stderr` - The STDERR stream of the call to the `stackql` binary. +- `exitcode` - The exit code of the call to the `stackql` binary. From 6b7c435f45f2caad58510e7280e96549f3320547 Mon Sep 17 00:00:00 2001 From: Yuncheng Date: Sun, 5 Feb 2023 23:24:54 +1100 Subject: [PATCH 2/3] minor style improvement --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a6aef7..b236fa2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ This action can be run on `ubuntu-latest`, `windows-latest`, and `macos-latest` 2. create the github token as a secret 3. In the execution step, pass the secret as environment variable with name "STACKQL_GITHUB_CREDS" -Check the "Use GitHub Provider" step in `.github/workflows/setup-stackql.yml` for the working example +Check the "Use GitHub Provider" step in [setup-stackql.yml](.github/workflows/setup-stackql.yml) for the working example + ### Example ``` - name: Use GitHub Provider @@ -40,7 +41,8 @@ Check the "Use GitHub Provider" step in `.github/workflows/setup-stackql.yml` fo 2. encode the key json file into base64 string 3. in execution step, run `sudo echo ${{ secrets. }} | base64 -d > sa-key.json` -Check the "Prep Google Creds" step in `.github/workflows/setup-stackql.yml` for the working example +Check the "Prep Google Creds" step in [setup-stackql.yml](.github/workflows/setup-stackql.yml) for the working example + ### Example ``` - name: Prep Google Creds (bash) From 1585e722f0611bed53996e33157bb044ebe5bb1e Mon Sep 17 00:00:00 2001 From: Yuncheng Yang <45674168+FabioYyc@users.noreply.github.com> Date: Tue, 7 Feb 2023 22:57:06 +1100 Subject: [PATCH 3/3] small fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b236fa2..36fd988 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Check the "Prep Google Creds" step in [setup-stackql.yml](.github/workflows/setu stackql exec -i ./examples/google-example.iql --auth='{ "google": { "type": "service_account", "credentialsfilepath": "sa-key.json" }}' ``` -## Input +## Inputs - `use_wrapper` - (optional) Whether to install a wrapper to wrap subsequent calls of the `stackql` binary and expose its STDOUT, STDERR, and exit code as outputs named `stdout`, `stderr`, and `exitcode` respectively. Defaults to `false`.