{"id":21262850,"url":"https://github.com/stackql/stackql-exec","last_synced_at":"2025-07-11T04:31:16.558Z","repository":{"id":65697776,"uuid":"597243730","full_name":"stackql/stackql-exec","owner":"stackql","description":"Github Action as a wrapper for executing a single command in stackql, maps all stackql exec args to actions args","archived":false,"fork":false,"pushed_at":"2024-10-28T21:40:42.000Z","size":257,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-28T22:30:38.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-04T00:26:37.000Z","updated_at":"2024-04-28T22:27:49.000Z","dependencies_parsed_at":"2024-10-28T22:38:44.405Z","dependency_job_id":null,"html_url":"https://github.com/stackql/stackql-exec","commit_stats":{"total_commits":100,"total_committers":2,"mean_commits":50.0,"dds":"0.020000000000000018","last_synced_commit":"f8096c7b3b5ef39f8f476c6e56f7b8a694bababd"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackql","download_url":"https://codeload.github.com/stackql/stackql-exec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225674897,"owners_count":17506272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T04:59:31.723Z","updated_at":"2024-11-21T04:59:32.297Z","avatar_url":"https://github.com/stackql.png","language":"JavaScript","readme":"[![StackQL Exec](https://github.com/stackql/stackql-exec/actions/workflows/stackql-exec-test.yml/badge.svg)](https://github.com/stackql/stackql-exec/actions/workflows/stackql-exec-test.yml)  \n\n# stackql-exec\nGithub Action as a wrapper for executing a single command in stackql, maps all stackql exec args to actions args\n\n# Usage\n\n## Provider Authentication\nAuthentication to StackQL providers is done via environment variables source from GitHub Actions Secrets.  To learn more about authentication, see the setup instructions for your provider or providers at the [StackQL Provider Registry Docs](https://stackql.io/registry).  \n\n## Inputs\n- **`query`** - stackql query to execute *(need to supply either __`query`__ or __`query_file_path`__)*\n- **`query_file_path`** - stackql query file to execute *(need to supply either __`query`__ or __`query_file_path`__)*\n- **`data_file_path`** - (optional) path to data file to pass to the stackql query preprocessor (`json` or `jsonnet`)\n- **`dry_run`** - (optional) set to `true` to print the query that would be executed without actually executing it (default is `false`)\n- **`vars`** - (optional) comma delimited list of variables to pass to the stackql query preprocessor (supported with `jsonnet` config blocks or `jsonnet` data files only), accepts `var1=val1,var2=val2`, can be used to source environment variables into stackql queries \n- **`query_output`** - (optional) output format of the stackql exec result, accepts `table`, `csv`, `json` and `text`, defaults to `json`\n- **`auth_obj_path`** - (optional) the path of json file that stores stackql AUTH string *(only required when using non-standard environment variable names)*\n- **`auth_str`** - (optional) stackql AUTH string *(only required when using non-standard environment variable names)*\n- **`is_command`** - (optional) set to `true` if the stackql execution is a command that does not return data (defaults to `false`)\n- **`on_failure`** - (optional) behavior on a failure in query, supported values are `exit` (default) and `continue`\n\n## Outputs\n\n- **`stackql-query-results`** - results from a stackql query (in the format specified)\n- **`stackql-command-output`** - text output from a stackql command (a query that does not return data)\n- **`stackql-query-error`** - error from a stackql query\n\n\u003e This action uses [setup-stackql](https://github.com/marketplace/actions/setup-stackql)\n\n## Examples\n\n### Inline `stackql` query example\n\nthis is an example of a command (that does not return data):\n\n```yaml\n    - name: exec github example\n      uses: ./\n      with:\n        is_command: 'true'\n        query: \"REGISTRY PULL github;\n      env: \n        STACKQL_GITHUB_USERNAME: ${{  secrets.STACKQL_GITHUB_USERNAME }}\n        STACKQL_GITHUB_PASSWORD: ${{  secrets.STACKQL_GITHUB_PASSWORD }}\n```\n\nthis is an example of a query that returns data:\n\n```yaml\n    - name: exec github example\n      uses: ./\n      with:\n        query: |\n          select total_private_repos\n          from github.orgs.orgs\n          where org = 'stackql'\"\n      env: \n        STACKQL_GITHUB_USERNAME: ${{  secrets.STACKQL_GITHUB_USERNAME }}\n        STACKQL_GITHUB_PASSWORD: ${{  secrets.STACKQL_GITHUB_PASSWORD }}\n```\n\n### Query file example using an inline `jsonnet` variable block and external variables\n\n`google-example.iql`\n```\n\u003c\u003c\u003cjsonnet\nlocal project = std.extVar(\"GOOGLE_PROJECT\");\nlocal zone = std.extVar(\"GOOGLE_ZONE\");\n{\n   project: project,\n   zone: zone,\n}\n\u003e\u003e\u003e\nSELECT status, count(*) as num_instances\nFROM google.compute.instances\nWHERE project = '{{ .project }}' and zone = '{{ .zone }}'\nGROUP BY status;\n```\n\nworkflow excerpt:  \n```yaml\n    - name: exec google example with query file using vars\n      id: stackql-exec-file-with-vars\n      uses: ./\n      with:\n        query_file_path: './stackql_scripts/google-example.iql'\n        vars: GOOGLE_PROJECT=${{ env.GOOGLE_PROJECT }},GOOGLE_ZONE=${{ env.GOOGLE_ZONE }}\n      env: \n        GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}\n        GOOGLE_PROJECT: ${{ vars.GOOGLE_PROJECT }}\n        GOOGLE_ZONE: ${{ vars.GOOGLE_ZONE }}\n```\n\n### Query file example using an external `jsonnet` data file and external variables\n\n`google-example.iql`\n```sql\nSELECT status, count(*) as num_instances\nFROM google.compute.instances\nWHERE project = '{{ .project }}' and zone = '{{ .zone }}'\nGROUP BY status;\n```\n\n`google-example.jsonnet`\n```\nlocal project = std.extVar(\"GOOGLE_PROJECT\");\nlocal zone = std.extVar(\"GOOGLE_ZONE\");\n{\n   project: project,\n   zone: zone,\n}\n```\n\nworkflow excerpt:  \n```yaml\n    - name: exec google example with query file and data file using vars\n      id: stackql-exec-file-with-data-file-and-vars\n      uses: ./\n      with:\n        query_file_path: './stackql_scripts/google-example.iql'\n        data_file_path: './stackql_scripts/google-example.jsonnet'\n        vars: GOOGLE_PROJECT=${{ env.GOOGLE_PROJECT }},GOOGLE_ZONE=${{ env.GOOGLE_ZONE }}\n      env: \n        GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}\n        GOOGLE_PROJECT: ${{ vars.GOOGLE_PROJECT }}\n        GOOGLE_ZONE: ${{ vars.GOOGLE_ZONE }}        \n```\n## Test action locally\nTo run unit tests locally against this action, use the following:\n\n```\nnpm i\nnpm run test lib/tests/utils.test.js\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fstackql-exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackql%2Fstackql-exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fstackql-exec/lists"}