Skip to content

Commit 4d2f157

Browse files
authored
Merge pull request #21 from stackql/improve/readme-usage-input
Improve/readme usage input
2 parents f9afc7c + 1585e72 commit 4d2f157

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

README.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,30 @@ The `stackql/setup-stackql` action is a JavaScript action that sets up StackQL C
99

1010
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.
1111

12-
# Auth
12+
# Usage
1313
[Learn more](https://stackql.io/docs/getting-started/authenticating) about authentication setup when running stackql
1414

15-
### Basic Example
15+
## Basic Example
1616
1. Set Auth variable, for example:
1717
```
1818
{ "github": { "type": "basic", "credentialsenvvar": "STACKQL_GITHUB_CREDS" } }
1919
```
2020
2. create the github token as a secret
2121
3. In the execution step, pass the secret as environment variable with name "STACKQL_GITHUB_CREDS"
2222

23-
Check the "Use GitHub Provider" step in `.github/workflows/setup-stackql.yml` for the working example
23+
Check the "Use GitHub Provider" step in [setup-stackql.yml](.github/workflows/setup-stackql.yml) for the working example
24+
25+
### Example
26+
```
27+
- name: Use GitHub Provider
28+
run: |
29+
stackql exec -i ./examples/github-example.iql --auth='{ "github": { "type": "basic", "credentialsenvvar": "STACKQL_GITHUB_CREDS" } }'
30+
env:
31+
STACKQL_GITHUB_CREDS: ${{ secrets.STACKQL_GITHUB_CREDS }}
32+
```
2433

25-
### json File Auth example
34+
35+
## json File Auth example
2636

2737
1. Set Auth variable, for example:
2838
```
@@ -31,4 +41,29 @@ Check the "Use GitHub Provider" step in `.github/workflows/setup-stackql.yml` fo
3141
2. encode the key json file into base64 string
3242
3. in execution step, run `sudo echo ${{ secrets.<name of the secret> }} | base64 -d > sa-key.json`
3343

34-
Check the "Prep Google Creds" step in `.github/workflows/setup-stackql.yml` for the working example
44+
Check the "Prep Google Creds" step in [setup-stackql.yml](.github/workflows/setup-stackql.yml) for the working example
45+
46+
### Example
47+
```
48+
- name: Prep Google Creds (bash)
49+
if: ${{ matrix.os != 'windows-latest' }}
50+
run: | ## use the secret to create json file
51+
sudo echo ${{ secrets.GOOGLE_CREDS }} | base64 -d > sa-key.json
52+
53+
- name: Use Google Provider
54+
run: |
55+
stackql exec -i ./examples/google-example.iql --auth='{ "google": { "type": "service_account", "credentialsfilepath": "sa-key.json" }}'
56+
```
57+
58+
## Inputs
59+
- `use_wrapper` - (optional) Whether to install a wrapper to wrap subsequent calls of
60+
the `stackql` binary and expose its STDOUT, STDERR, and exit code as outputs
61+
named `stdout`, `stderr`, and `exitcode` respectively. Defaults to `false`.
62+
63+
## Outputs
64+
This action does not configure any outputs directly. However, when you set the `use_wrapper` input
65+
to `true`, the following outputs are available for subsequent steps that call the `stackql` binary:
66+
67+
- `stdout` - The STDOUT stream of the call to the `stackql` binary.
68+
- `stderr` - The STDERR stream of the call to the `stackql` binary.
69+
- `exitcode` - The exit code of the call to the `stackql` binary.

0 commit comments

Comments
 (0)