Skip to content

Commit

Permalink
Merge pull request #291 from github/simon-engledew/output-codeql-path
Browse files Browse the repository at this point in the history
Add a codeql-path output to the init action
  • Loading branch information
simon-engledew committed Nov 5, 2020
2 parents 0ed3207 + f761241 commit f13bd45
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./init
id: init
with:
languages: javascript
config-file: ./.github/codeql/codeql-config.yml
# confirm steps.init.outputs.codeql-path points to the codeql binary
- name: Print CodeQL Version
run: ${{steps.init.outputs.codeql-path}} version --format=json
- uses: ./analyze
4 changes: 2 additions & 2 deletions .github/workflows/python-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:

- name: Initialize CodeQL
uses: ./init
id: init
with:
tools: latest
languages: python
Expand All @@ -62,8 +63,7 @@ jobs:
esac
echo ${basePath}
codeql_version="0.0.0-$(cat "$GITHUB_WORKSPACE/src/defaults.json" | jq -r .bundleVersion | rev | cut -d - -f 1 | rev)"
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "${basePath}/hostedtoolcache/CodeQL/$codeql_version/x64/codeql"
$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"
- name: Setup for extractor
run: |
echo $CODEQL_PYTHON
Expand Down
3 changes: 3 additions & 0 deletions init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ inputs:
description: Try to auto-install your python dependencies
required: true
default: 'true'
outputs:
codeql-path:
description: The path of the CodeQL binary used for analysis
runs:
using: 'node12'
main: '../lib/init-action.js'
1 change: 1 addition & 0 deletions lib/init-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ async function run() {
);
}
}

core.setOutput("codeql-path", config.codeQLCmd);
} catch (error) {
core.setFailed(error.message);
console.log(error);
Expand Down

0 comments on commit f13bd45

Please sign in to comment.