Commit Graph

117 Commits

Author SHA1 Message Date
Henry Mercer 5f644f971e Upgrade TypeScript to 9.2.0 2023-01-18 20:59:57 +00:00
Henry Mercer 375dacad24 Only print the full error message in debug mode 2022-12-02 14:38:40 +00:00
Henry Mercer 3d90c4f911 Improve error message when failed SARIF file doesn't process as expected 2022-11-30 11:27:03 +00:00
Henry Mercer e628ee0ae1 Push unsuccessful execution API error detection into upload library 2022-11-29 16:25:29 +00:00
Henry Mercer d0517be03a Ensure we finish the log group when waiting for processing 2022-11-25 17:55:01 +00:00
Henry Mercer 5296a763b1 Upload failed SARIF files to Code Scanning 2022-11-25 17:52:50 +00:00
Henry Mercer 79f8286c68 Refactoring: Separate out workflow related functionality
No semantic changes.
2022-11-23 19:27:01 +00:00
Henry Mercer 39fe7aa8a1 Remove dead guard for GHES 3.0 2022-11-23 13:57:07 +00:00
Henry Mercer 9df773d1a3 Remove unneeded apiDetails input to getApiClient 2022-11-14 19:55:30 +00:00
Henry Mercer 8ecbaea022 Remove support for empty analysis keys from runner 2022-11-14 18:55:31 +00:00
Henry Mercer b498c79130 Remove concept of Actions / runner mode 2022-11-14 16:37:48 +00:00
Edoardo Pirovano 862a512899 Prune results of Ruby query from SARIF 2022-11-04 14:57:13 +00:00
David Verdeguer a03f3bd585 Build js 2022-09-07 09:45:19 +02:00
CI 0e3ae6e68a fix: clarify upload-sarify category uniqueness error message 2022-08-05 10:59:35 -04:00
Chris Gavin 366e88c2c1 Fix processing errors being caught and logged as a warning rather than failing the workflow run. 2022-05-03 10:06:19 +01:00
Henry Mercer 7c2be06006 Factor out test mode determination code 2022-04-28 19:13:22 +01:00
Chris Gavin 9885f86fab Re-enable waiting for processing by default, using the new API semantics. 2022-03-30 12:24:59 +01:00
Andrew Eisenberg a92e8775d8 Use the checkout_path for getting the commit oid
This commit also adds a new integration check to verify this.

When running in test mode, payloads will not be uploaded. Instead, they
will be saved to disk so that they can be inspected later.
2022-03-01 12:40:52 -08:00
Thomas Horstmeyer 3469c69bba Merge branch 'main' into use-better-base-sha 2022-02-02 13:52:13 +00:00
Andrew Eisenberg 36419a79c1 Avoid sending status reports in test mode 2022-02-01 10:12:35 -08:00
Thomas Horstmeyer ec0b3ae7ff remove some debug info 2022-02-01 15:39:11 +00:00
Thomas Horstmeyer e836f97769 Detect merge base as base_sha for upload 2022-02-01 15:38:43 +00:00
Andrew Eisenberg ab1f709732 Allow duplicate categories in the same validation step
A single SARIF file should be allowed to have duplicated
categories.
2022-01-13 10:35:03 -08:00
Andrew Eisenberg 8454e21c9c Change category uniqueness test
Turboscan only allows a single combination of tool name and automation
details id for testing category uniqueness.

Previously, the check in the action was not entirely correct since it
only looked at the _category_ and not the combination of the category
and the tool name.

It's even more precise now since it is looking at the actual, computed
value of the automation details id, rather than an inputted value of
the category.

This change also includes a refactoring where the action is now avoiding
multiple parsing/stringifying of the sarif files. Instead, sarif is
parsed once at the start of the process and stringified once, after
sarif processing is completely finished.
2022-01-12 15:26:34 -08:00
Chris Gavin b9bd459b70 Add a clarifying comment to a break. 2021-11-17 15:52:36 +00:00
Chris Gavin 215c4f5ff5 Move the delay to the end of the loop. 2021-11-17 15:51:50 +00:00
Chris Gavin 4eef7ef32c Split out waiting for processing. 2021-11-17 13:20:36 +00:00
Chris Gavin e0b9b9a248 Check for errors in the analysis status response. 2021-11-17 12:33:42 +00:00
Chris Gavin 823bb21bbb Add a default value for wait-for-processing. 2021-11-17 12:33:38 +00:00
Chris Gavin 49fc4c9b40 Reduce log message level.
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2021-11-17 12:14:48 +00:00
Chris Gavin 21a786fda0 Improve a log message.
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2021-11-17 12:14:25 +00:00
Chris Gavin 316ad9d919 Add an option to allow waiting until an analysis has been processed before finishing the Action. 2021-11-17 12:14:13 +00:00
Andrew Eisenberg 6a98a4b500 Allow multiple uploads in a single job
They must all have a unique category. The category will be
converted into an environment variable.
2021-11-15 09:16:25 -08: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 d9849b8ca1 Rebuild after TypeScript version bump 2021-07-27 17:59:59 +01:00
Arthur Baars f94f1ed663 Rename checkoutPath to either workspacePath or sourceRoot 2021-07-14 13:39:45 +02:00
Edoardo Pirovano 02e8dcfe9c Fix out of memory in hash computation 2021-06-07 15:12:45 +01: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
Aditya Sharad 031ec8753a Group log messages while uploading results 2021-05-20 12:32:10 -07:00
David Verdeguer 3b741b35ad Use actionsUtil.computeAutomationID on upload-lib 2021-05-03 19:56:04 +02:00
David Verdeguer c6e734ccc5 Add category option to runner 2021-04-29 14:59:36 +02:00
David Verdeguer 76f5ada659 Don't use getOptionalInput on the runner codepath 2021-04-29 08:00:19 +02:00
David Verdeguer 40fb1f3f00 Add category input 2021-04-28 14:32:16 +02:00
David Verdeguer 496bf0ec11 Ignore non-string values in populateRunAutomationDetails 2021-04-20 12:53:16 +02:00
David Verdeguer 0ece0d074b Fix populateRunAutomationDetails for null environments 2021-04-16 09:24:34 +02:00
David Verdeguer de611b2de3 Prevent the automationDetails to be regenerated if it already exists 2021-04-16 07:47:42 +02:00
David Verdeguer 47755f0910 Add automationdetails id to runs 2021-04-15 16:20:49 +02:00
Andrew Eisenberg 08fae3caba Display better error message on invalid sarif
Specifically, some third party tools do not include a `results`
block for runs when there is an error. This change adds a more
explicit error message for this situation.
2021-03-18 09:03:42 -07:00
Chris Gavin c9ca4ec1bd Convert GitHub variant to an enum. 2021-02-15 09:30:16 +00:00