Skip to content

Commit 08d0b7e

Browse files
committed
windows runner fix
1 parent 48706d8 commit 08d0b7e

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed
File renamed without changes.

.github/workflows/stackql-exec.yml renamed to .github/workflows/stackql-exec-test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,51 @@ jobs:
4444
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
4545
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
4646

47+
# `csv` output
48+
- name: github query example using the query input (csv output)
49+
id: stackql-query-csv-output
50+
uses: ./
51+
with:
52+
query_output: csv
53+
query: |
54+
select visibility, count(*) as number_of_repos
55+
from github.repos.repos
56+
where org = 'stackql'
57+
group by visibility
58+
env:
59+
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
60+
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
61+
62+
# `table` output
63+
- name: github query example using the query input (table output)
64+
id: stackql-query-table-output
65+
uses: ./
66+
with:
67+
query_output: table
68+
query: |
69+
select visibility, count(*) as number_of_repos
70+
from github.repos.repos
71+
where org = 'stackql'
72+
group by visibility
73+
env:
74+
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
75+
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
76+
77+
# `text` output
78+
- name: github query example using the query input (text output)
79+
id: stackql-query-text-output
80+
uses: ./
81+
with:
82+
query_output: text
83+
query: |
84+
select visibility, count(*) as number_of_repos
85+
from github.repos.repos
86+
where org = 'stackql'
87+
group by visibility
88+
env:
89+
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
90+
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
91+
4792
#
4893
# run a query using the `query_file_path` input
4994
#

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
description: comma delimited list of vars to be passed to query preprocessor (supported with jsonnet config blocks or jsonnet data files only)
1616
required: false
1717
query_output:
18-
description: output format
18+
description: output format, supported formats include `json` (default), `csv`, `table` and `text`
1919
default: 'json'
2020
required: false
2121
auth_obj_path:

lib/utils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ async function getStackqlCommand(core) {
9595
}
9696

9797
const isWindows = process.platform === "win32";
98-
const executable = isWindows ? "stackql.exe" : "stackql";
99-
98+
const executablePath = process.env.STACKQL_CLI_PATH || '.';
99+
const stackQLExecutable = isWindows ? `${executablePath}\\stackql.exe` : "stackql";
100+
100101
try {
101-
const stackQLCommand = `${executable} ${args.join(" ")}`;
102+
const stackQLCommand = `${stackQLExecutable} ${args.join(" ")}`;
102103
core.exportVariable('STACKQL_COMMAND', `${stackQLCommand}`);
103104
// core.info(`STACKQL_COMMAND: ${stackQLCommand}`);
104105
} catch (error) {

0 commit comments

Comments
 (0)