Commit Graph

45 Commits

Author SHA1 Message Date
Fotis Koutoulakis (@NlightNFotis)
b53826d56d review-comments: remove syntax-error handling for SARIF from upload-lib 2025-04-01 15:10:16 +01:00
Fotis Koutoulakis (@NlightNFotis)
72a2b1295e feat: classify some observed SARIF errors as InvalidSarifUploadError 2025-03-31 12:17:23 +01:00
github-actions[bot]
44e03577b2 Rebuild 2024-12-03 18:39:38 +00:00
Remco Vermeulen
642bbfc83a Turn invalid helpUri attribute into a warning 2024-09-16 20:22:13 -07:00
Koen Vlaswinkel
931fabe1ef Remove feature flag for combine SARIF files deprecation warning 2024-05-14 11:00:12 +02:00
Koen Vlaswinkel
725ed4139d Add tests for shouldShowCombineSarifFilesDeprecationWarning 2024-05-02 10:20:11 +02:00
Koen Vlaswinkel
5d73b1bd71 Remove incorrect log message 2024-04-17 10:20:46 +02:00
nickfyson
d3c32a84cb fix test to respect updated logging behaviour 2024-04-03 21:04:50 +01:00
nickfyson
6514cbb626 improve logging coverage when uploaing sarif files 2024-04-03 15:45:28 +01:00
Henry Mercer
fdea2a523d Remove result pruning for CodeQL 2.11.2 2023-11-27 12:58:49 +00:00
Andrew Eisenberg
9c5706e1a2 Avoid throwing validation error on invalid URIs
The recent update of jsonschema inadvertently caused extra validation of
`uri-reference` formatted properties. This change ensures that these
errors are converted to warnings.

Note that we cannot revert the change to jsonschema since the old
version does not handle `uniqueItems` correctly.
2023-05-25 10:18:12 -07:00
Angela P Wen
da583b07a7 Add workload_run_attempt to analysis upload (#1658)
* Refactor status report upload logic

Previously we had duplicated the logic to check `GITHUB_RUN_ID`. We now call the `getWorkflowRunID()` method for the status report upload method, and move the logic for the run attempt to `getWorkflowRunAttempt()`

* Add `workflow_run_attempt` to analysis payload

* Stop allowing `undefined` run IDs and attempts

Because we already throw an error if the ID or attempt aren't numbers, we don't have to allow `undefined` values into the payload.
2023-04-26 02:13:27 +00:00
Henry Mercer
5f644f971e Upgrade TypeScript to 9.2.0 2023-01-18 20:59:57 +00:00
Henry Mercer
39fe7aa8a1 Remove dead guard for GHES 3.0 2022-11-23 13:57:07 +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
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
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
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
David Verdeguer
3b741b35ad Use actionsUtil.computeAutomationID on upload-lib 2021-05-03 19:56:04 +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
351d36fd18 Add test for existing automationDetails 2021-04-19 09:04:58 +02:00
David Verdeguer
47755f0910 Add automationdetails id to runs 2021-04-15 16:20:49 +02:00
Chris Gavin
c9ca4ec1bd Convert GitHub variant to an enum. 2021-02-15 09:30:16 +00:00
Robin Neatherway
369cad8272 Use the fully qualified ref name 2021-01-13 12:16:10 +00:00
Robin Neatherway
a7f3c648eb Update test to check base ref/sha values 2021-01-13 11:57:55 +00:00
Robert
bd4e3adfd9 Add test of finding SARIF files recursively 2021-01-04 13:12:30 +00:00
Robin Neatherway
d99e994194 Fix test to be immune to running on Actions 2020-11-30 18:35:55 +00:00
Robin Neatherway
dff118f7ad Use version information to construct payload 2020-11-30 16:45:18 +00:00
Chris Raynor
a184d50a26 Running lint-fix 2020-09-14 10:44:43 +01:00
Robert Brignull
6f422a4303 add debug mode to limit output 2020-08-27 14:26:44 +01:00
Robert Brignull
09677dada5 rename CLI to runner 2020-08-25 17:44:30 +01:00
Robert Brignull
34b372292b commit node_modules and generated files 2020-08-11 12:43:27 +01:00
Robert
87758a1402 Upload much more data in status reports 2020-07-24 15:01:44 +01:00
Robert Brignull
0086c2ecdb use @actions/github 2020-07-06 16:25:26 +01:00
Sam Partington
c0c67ce80f Reduce debug output in tests 2020-06-22 17:13:47 +01:00
Robert Brignull
8fb9090674 fix tests 2020-05-22 17:09:41 +01:00
Robert Brignull
ae301902e1 output a better error message 2020-05-22 14:56:20 +01:00
Robert Brignull
ddee374101 validate sarif against schema before uploading 2020-05-22 14:19:16 +01:00