-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Actions extractor and placeholder Actions QL packs #17850
Conversation
Since I had the code checked out to fix the formatting, I took the liberty of adding auto-labeler support as well 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks plausible to me 👍 I did a quick grep of uses of CODEQL_EXTRACTOR_JAVASCRIPT_*
env vars and I didn't spot anything missing.
Bash parts LGTM 👍 (just a minor nitpick)
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the change to be bash script may cause problems if the environment variables are uninitialised. Did you test the change?
I'll give them a try locally. I'm planning integration tests once everything is hooked up into the CLI build. |
The PR implements an extractor for GitHub Actions workflows. The extractor more or less just forwards to the JavaScript extractor to do the actual extraction. The JavaScript extractor handles both JS and YAML. For now, we're only using the YAML, but we have ambitions to analyze JS code embedded within a workflow in the future. The
autobuild.*
scripts copy all of theCODEQL_EXTRACTOR_ACTIONS_*
environment variables into theCODEQL_EXTRACTOR_JAVASCRIPT_*
variables for the JavaScript extractor. In addition, if no path filters are specified by the user, we supply a default set of path filters the extractor only YAML files that are likely to be Actions workflows or reusable Actions.In addition to the extractor itself, I've added placeholder CodeQL packs for the library, queries, and tests. There are two placeholder tests: one that imports a
.qll
file from the library pack, and one that runs a query from the query pack. Note that the library pack does not have a dbscheme. Instead, it depends oncodeql/javascript-all
, since the actual extraction is done by the JavaScript extractor with the JavaScript dbscheme. Theextractor: actions
property on the query pack ensures that the queries are treated as being for theactions
language, rather than thejavascript
language.Note to reviewers: I know nothing about Bash except what I've Googled in the last few hours. Please take a close look at the
autobuild.sh
script.A subsequent PR will add Bazel files to incorporate the new extractor into the CLI build.