Skip to content

Commit 5b21e64

Browse files
Merge pull request #3 from stackql/feature/setup-auth
Feature/setup auth
2 parents ff03f2a + 71aaf6b commit 5b21e64

File tree

4 files changed

+33
-13
lines changed

4 files changed

+33
-13
lines changed

.github/workflows/set-up-stackql.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Setup Terraform'
1+
name: 'Setup StackQL'
22

33
on:
44
push:
@@ -23,6 +23,14 @@ jobs:
2323
- name: Setup stackql
2424
uses: ./
2525

26+
2627
- name: Validate Stackql Version
2728
run: |
28-
stackql --version
29+
stackql --version
30+
31+
- name: Use GitHub Provider
32+
run: |
33+
stackql exec -i ./examples/get-github-commits.iql --auth="${AUTH}"
34+
env:
35+
AUTH: ${{ vars.AUTH }}
36+
STACKQL_GITHUB_CREDS: ${{ secrets.STACKQL_GITHUB_CREDS }}

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# setup-stackql
2+
3+
The `stackql/setup-stackql` action is a JavaScript action that sets up Terraform CLI in your GitHub Actions workflow by:
4+
5+
- Downloading a latest Stackql CLI and adding it to the `PATH`.
6+
- Setup AUTH env var in the Github Action
7+
8+
## Auth object string
9+
Example
10+
```
11+
{
12+
"google": { "credentialsfilepath": "creds/stackql-demo.json", "type": "service_account" },
13+
"okta": { "credentialsenvvar": "OKTA_SECRET_KEY", "type": "api_key", credentials: '<your credentials>' }
14+
}
15+
```
16+

action.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
name: 'StackQL Studio - Setup StackQL'
22
description: 'Sets up StackQL CLI in your GitHub Actions workflow.'
33
author: 'Yuncheng Yang, StackQL'
4-
inputs:
5-
platform:
6-
description: 'Platform that function is running on'
7-
required: false
8-
# authentications_object_string:
9-
# description: 'The authentication object'
10-
# required: true
11-
# stackql_wrapper:
12-
# description: 'Whether or not 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 `true`.'
13-
# default: 'true'
14-
# required: false
4+
5+
156
runs:
167
using: 'node16'
178
main: 'dist/index.js'

examples/get-github-commits.iql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
REGISTRY PULL github v23.01.00104;
2+
SHOW PROVIDERS;
3+
select total_private_repos
4+
from github.orgs.orgs
5+
where org = 'stackql';

0 commit comments

Comments
 (0)