Commit Graph

59 Commits

Author SHA1 Message Date
Alex Croteau 3cc87990f0 Updates javascript files 2022-01-31 20:06:18 -05:00
Alex Croteau 1eaaf07b91 Adds check on inputs and compiled files 2022-01-31 20:06:17 -05:00
Andrew Eisenberg f18151cc59 Update error message and remove feature flag preloading
Discussion here https://github.com/github/codeql-action/pull/882#discussion_r789924177
shows that properly handling preloading feature flag errors is complex
and the benefit we get from it does not offset the complexity.
2022-01-21 11:20:48 -08:00
Edoardo Pirovano e677af3fd0 Make name of debugging artifact and DB within it configurable 2022-01-07 15:10:26 +00:00
Henry Mercer 9de1702400 Document use of redundant feature flag API call 2022-01-06 11:58:02 +00:00
Edoardo Pirovano 00d4d60204 Always upload DB when in debug mode 2022-01-04 16:49:31 +00:00
Henry Mercer 5e87034b3b Explicitly pass repository to feature flags constructor
As suggested in review: The `GITHUB_REPOSITORY` environment variable is
only available on Actions. Passing it in explicitly avoids potentially
crashing if this code is called from the runner.
2021-12-15 17:03:43 +00:00
Henry Mercer d6499fad61 Use new feature flag architecture when uploading databases 2021-12-15 13:17:05 +00:00
Chris Gavin 4eef7ef32c Split out waiting for processing. 2021-11-17 13:20:36 +00:00
Edoardo Pirovano f360da772a Sanitize artifact name before using 2021-11-05 08:40:16 +00:00
Edoardo Pirovano 375c14729e Include matrix information in debug artifact name 2021-11-04 19:20:24 +00:00
Edoardo Pirovano bc31f604d3 Add an option to upload some debugging artifacts 2021-11-01 16:12:50 +00:00
Chuan-kai Lin 70b730eb7d Add RAM and threads options to init action 2021-10-28 15:09:59 -07:00
Edoardo Pirovano 1f4460b9fb Make use of multi-language and indirect tracing 2021-09-22 16:12:23 +01:00
Andrew Eisenberg 40568daca8 Fix compile errors introduced by typescript 4.4.2
4.4.2 introduces a breaking change that the variable in a catch clause
is now `unknown` type. So, we need to cast the `e`, `err`, or `error`
variables to type `Error`.
2021-09-10 14:06:27 -07:00
Edoardo Pirovano 0c4306b672 Pass --ram flag to database finalize 2021-08-12 18:12:28 +01:00
Edoardo Pirovano d9849b8ca1 Rebuild after TypeScript version bump 2021-07-27 17:59:59 +01:00
Edoardo Pirovano ef852c006a Support splitting of DB creation and query execution 2021-06-28 17:14:22 +01:00
Robert 146c897909 Upload CodeQL databases 2021-06-22 13:05:12 +01:00
Robert d893508e3a Revert "Upload CodeQL databases" 2021-06-21 10:26:02 +01:00
Robert f3cd5fa001 Add workflow input to disable uploads 2021-06-18 09:56:15 +01:00
Robert b985a67b97 Only attempt to upload on dotcom 2021-06-16 17:24:26 +01:00
Robert d693b3cb0d Check if on default branch before uploading database 2021-06-16 14:43:42 +01:00
Robert 2a9a602a5e Upload databases from analyze action 2021-06-10 16:09:58 +01:00
Edoardo Pirovano ddb83a462d Cleanup CodeQL DBs and output their location for later steps 2021-06-04 18:54:15 +01:00
Andrew Eisenberg f60ef170b0 Cleaning up comments around env vars
Also, move `getTemporaryDirectory` back to `actions-util`.
2021-06-03 11:33:20 -07:00
Andrew Eisenberg 3708898bf2 Add environment variables to signal feature and version to the CLI
This PR ensures environment variables are set before any invocation of
the CLI.  Here is a list of vars that are set:

https://github.com/github/codeql-coreql-team/issues/1124#issuecomment-852463521

This ensures the CLI knows the features and versions of the containing
actions/runner.

Additionally:

- Fix the user agent so that it more closely aligns with user agent
  spec
- Refactor environment variable initialization so that it all happens in
  one place and call.
- Move Mode, getRequiredEnvParam, setMode, getMode out of actions-util
  and into util. actions-util is meant for utils only called by the
  action, not the runner.

The `prepareLocalRunEnvironment()` method is most likely deprecated and
should be removed. I originally added it because I had a way of working
where I would run the action from my local machine to test out changes,
but this was always a little flaky. So, I no longer use this way of
working. I will probably remove it soon.
2021-06-02 11:06:02 -07:00
Andrew Eisenberg 47588796b4 Send the version and mode with the user agent
This commit changes the way the action determines if running in action
or runner mode. There is now an environment variable that is set at the
beginning of the process and elsewhere in the process, we can check to
see if the variable is set.
2021-05-31 09:03:29 -07:00
Edoardo Pirovano 79c79f1be5 Add configuration option to set CodeQL DB location 2021-05-18 00:13:36 +01:00
David Verdeguer c93cbc943a Forward category input to codeql cli 2021-05-03 19:41:53 +02:00
Chris Gavin 7b72f1c330 Merge main into allow-override-temp. 2021-02-15 11:45:08 +00:00
Chris Gavin ed751ece83 Allow overriding path of temporary files. 2021-02-01 15:34:13 +00:00
Sam Partington c2377b2e49 Remove parameters from uploadFromActions
Retrieve the relevant values in the method itself instead.
2021-01-28 15:37:09 +00:00
Chris Gavin 94b32884f9 Dump logs to stdout instead of stderr to avoid synchronization problems. 2021-01-26 09:47:31 +00:00
Chris Gavin 8705aaff32 Walk log filex manually rather than using the Actions globber. 2021-01-26 09:21:38 +00:00
Chris Gavin 219142571c Upload debug logs automatically when ACTIONS_STEP_DEBUG is enabled. 2021-01-25 15:44:31 +00:00
Sam Partington c7275a75ce Don't re-retrieve GitHub version when already have it
https://github.com/github/codeql-action/commit/54e0c67332afd925b1a71c346726efc5c788b260#r45693026
https://github.com/github/codeql-action/commit/54e0c67332afd925b1a71c346726efc5c788b260#r45693030
2021-01-06 11:40:16 +00:00
Sam Partington 54e0c67332 Revert "Retrieve GitHubVersion when used rather than passing around"
This reverts commit 6de1b753c2.

https://github.com/github/codeql-action/pull/323#discussion_r551960301
2021-01-06 11:06:01 +00:00
Sam Partington 1da4ce5a03 Ensure stats get sent when not uploading results
https://github.com/github/codeql-action/pull/323#discussion_r551948732
2021-01-06 10:52:16 +00:00
Sam Partington 6de1b753c2 Retrieve GitHubVersion when used rather than passing around 2020-12-22 11:49:42 +00:00
Sam Partington 82a8fa443e Merge branch 'main' into split-upload-method 2020-12-22 11:23:49 +00:00
Sam Partington ff28c8d403 Move uploading side-effect out of runAnalyze
https://github.com/github/codeql-action/pull/323#discussion_r530978010
2020-11-27 12:27:10 +00:00
Eric Cornelissen e6ea8cbae0 Run npm run build 2020-11-25 22:46:30 +01:00
Sam Partington 3ee4739b13 Make anonymous objects into variables for readability 2020-11-24 11:23:53 +00:00
Sam Partington 20567b5888 Introduce parameter object for API params that travel together 2020-11-23 14:39:01 +00:00
Simon Engledew eb4226ede4 Scanning endpoint failures should not halt the scan 2020-11-19 15:49:46 +00:00
David Verdeguer d6287621f6 Fail the analyze action when some language fails to run the queries 2020-10-22 10:22:27 +02:00
Robin Neatherway 7795860c11 Do not always overwrite the GITHUB_REF for PRs
As we move towards analysing the merge commit for pull requests by
default, we should stop sending `/refs/pull/n/head` rather than
`refs/pull/n/merge` _unless_ the checked-out SHA has actually changed.
Here we assume that any change (compared to GITHUB_SHA) indicates that
`git checkout HEAD^2` has been run earlier. This may sometimes be
incorrect (e.g. `git checkout mybranch`), but in that case the ref
would be wrong either way.
2020-09-17 13:11:06 +01:00
Robert Brignull c1cee53da5 Add getOptionalInput and getRequiredInput 2020-09-15 18:47:50 +01:00
Robert Brignull 121fd331cd Introduce actions-util.ts 2020-09-15 14:01:21 +01:00