Skip to content

Commit

Permalink
windows runner fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyaven committed Apr 25, 2024
1 parent 48706d8 commit 08d0b7e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,51 @@ jobs:
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}

# `csv` output
- name: github query example using the query input (csv output)
id: stackql-query-csv-output
uses: ./
with:
query_output: csv
query: |
select visibility, count(*) as number_of_repos
from github.repos.repos
where org = 'stackql'
group by visibility
env:
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}

# `table` output
- name: github query example using the query input (table output)
id: stackql-query-table-output
uses: ./
with:
query_output: table
query: |
select visibility, count(*) as number_of_repos
from github.repos.repos
where org = 'stackql'
group by visibility
env:
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}

# `text` output
- name: github query example using the query input (text output)
id: stackql-query-text-output
uses: ./
with:
query_output: text
query: |
select visibility, count(*) as number_of_repos
from github.repos.repos
where org = 'stackql'
group by visibility
env:
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}

#
# run a query using the `query_file_path` input
#
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
description: comma delimited list of vars to be passed to query preprocessor (supported with jsonnet config blocks or jsonnet data files only)
required: false
query_output:
description: output format
description: output format, supported formats include `json` (default), `csv`, `table` and `text`
default: 'json'
required: false
auth_obj_path:
Expand Down
7 changes: 4 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ async function getStackqlCommand(core) {
}

const isWindows = process.platform === "win32";
const executable = isWindows ? "stackql.exe" : "stackql";

const executablePath = process.env.STACKQL_CLI_PATH || '.';
const stackQLExecutable = isWindows ? `${executablePath}\\stackql.exe` : "stackql";

try {
const stackQLCommand = `${executable} ${args.join(" ")}`;
const stackQLCommand = `${stackQLExecutable} ${args.join(" ")}`;
core.exportVariable('STACKQL_COMMAND', `${stackQLCommand}`);
// core.info(`STACKQL_COMMAND: ${stackQLCommand}`);
} catch (error) {
Expand Down

0 comments on commit 08d0b7e

Please sign in to comment.