Commit Graph

45 Commits

Author SHA1 Message Date
Cornelius Riemenschneider 3038e979a8 Remove the lua tracer feature flag check from the codeql-action.
Always defer to the CLI on the Lua tracer state from now on.
2022-09-13 11:23:32 +00:00
Andrew Eisenberg 0e98efa2bb Add support for downloading packs from GHES
This change adds:

- new `registries` block allowed in code scanning config file
- new `registries-auth-tokens` input in init action
- Change the downloadPacks function so that it accepts new parameters:
    - registries block
    - api auth
- Generate a qlconfig.yml file with the registries block if one is
  supplied. Use this file when downloading packs.
- temporarily set the `GITHUB_TOKEN` and `CODEQL_REGISTRIES_AUTH` based
  on api auth

TODO:

1. integration test
2. handle pack downloads when the config is generated by the CLI
2022-08-30 10:04:30 -07:00
Henry Mercer e195431677 Override CODEQL_EXTRACTOR_GO_BUILD_TRACING with on when it's true 2022-08-24 11:48:32 +01:00
Henry Mercer e1cd41a365 Add tests for toolcache bypassing 2022-08-16 16:19:08 +01:00
Henry Mercer d45b0eba23 Improve readability of CodeQL bundle tests 2022-08-16 16:18:41 +01:00
Henry Mercer 5862bae77e Bypass toolcache when feature flag enabled 2022-08-16 16:18:11 +01:00
Edoardo Pirovano 4139682b64 Add telemetry for TRAP caching 2022-08-16 11:54:31 +01:00
Andrew Eisenberg fa2bc211fd Merge branch 'aeisenberg/unrevert-query-filters' into aeisenberg/fix-config-files 2022-08-11 14:57:16 -07:00
Chris Gavin bbdc9efa94 Use the API URL from the environment if it is present. 2022-08-11 08:38:11 +01:00
Andrew Eisenberg 0403fb7d8c Merge branch 'main' into aeisenberg/fix-config-files 2022-08-10 15:39:35 -07:00
Edoardo Pirovano 8f867dcb21 Introduce TRAP caching 2022-08-05 17:48:05 +01:00
Andrew Eisenberg 01d16b1e01 Merge branch 'main' into aeisenberg/fix-config-files 2022-07-13 14:05:48 -07:00
Henry Mercer b316baae94 Merge remote-tracking branch 'origin/main' into henrymercer/one-click-debug 2022-07-12 16:22:05 +01:00
Henry Mercer 7e94a6cbca Print diagnostic messages when debug logging enabled
This commit prints diagnostic messages to the Actions log when debug
logging is enabled by passing `debug: true` to `codeql-action/init` or
enabling Actions step debug logging.
2022-07-01 18:56:12 +01:00
Henry Mercer c736697abf Remove toolcache decorator
This decorator enabled us to use the functionality of the Actions
toolcache within the runner too.
Now that we've deleted the runner we no longer need it.
2022-06-30 09:16:10 +01:00
Andrew Eisenberg 6fabde2be8 Add packs and queries from input
This commit adds the packs and queries from the actions input to the
config file used by the CodeQL CLI.

When the `+` is used, the actions input value is combined with the
config value and when it is not used, the input value overrides the
config value.

This commit also adds a bunch of integration tests for this feature.
In order to avoid adding too many new jobs, all of the tests are
run sequentially in a single job (matrixed across relevant operating
systems and OSes).
2022-06-28 14:07:51 -07:00
Cornelius Riemenschneider ab7316e0c5 Implement unit tests for reading the Lua tracer FF in analyze-action. 2022-06-27 16:04:29 +00:00
Cornelius Riemenschneider db50adab01 Add tests for the Lua feature flag. 2022-05-16 09:16:41 +00:00
Chuan-kai Lin 9a44540e25 Include custom query help in analysis results 2021-11-03 13:19:01 -07: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 70d2efc353 Enforce a minimum version of CodeQL CLI 2021-08-18 11:48:12 +01:00
Edoardo Pirovano d9849b8ca1 Rebuild after TypeScript version bump 2021-07-27 17:59:59 +01:00
Simon Engledew 26ade03b50 Just reverse test case 2021-06-24 18:00:10 +01:00
Simon Engledew 9200db3ec4 Restore original getCodeQLActionRepository behaviour 2021-06-24 17:52:48 +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
Robert 8c91ba83e2 Introduce our own toolcache implementation for use by the runnner 2021-04-22 15:31:15 +01:00
Josh Soref c4fced7348 Fix spelling errors
spelling: executable
spelling: github
spelling: javascript
spelling: latest
spelling: occurred
spelling: parameter

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-18 09:40:47 -07:00
Robert 378f30f95d call setupActionsVars in the tests too 2021-03-16 13:43:28 +00:00
Robert d698cb3d2b Make unguarded-action-lib better at ignoring uses of toolcache 2021-03-16 13:14:17 +00:00
Chris Gavin bb51ece0b4 When downloading the CodeQL bundle, only use the GitHub AE endpoint on GitHub AE, and check it first. 2021-03-07 11:18:54 +00:00
Sam Partington ab9b1a72db Fix tests
Previously, most tests were using https://github.com and only the first was using https://github.example.com. As it happens, https://github.com works for all of them.
2020-11-24 11:10:25 +00:00
Sam Partington 20567b5888 Introduce parameter object for API params that travel together 2020-11-23 14:39:01 +00:00
Robert 80b43ca9d3 send action ref and tool version in status reports 2020-11-12 12:27:31 +00:00
Chris Raynor 10479a214a Merge branch 'main' into cbraynor/fix206 2020-10-01 11:09:05 +01:00
Chris Raynor 122c9b7f24 Switching to import/order instead of sort-imports 2020-10-01 11:03:46 +01:00
Marco Gario d5029a8680 Platform specific bundle 2020-10-01 10:04:48 +02:00
Chris Raynor 228546a1e5 Resolve violations of sort-imports lint
Resolves #206
2020-09-29 14:43:37 +01:00
Chris Raynor 41464b1396 Allowing a cached version of the CodeQL bundle sometimes
To save time downloading the CodeQL bundle we're pre-downloading it into the
hosted Actions runner, but because the release schedule is different there may
be some version drift. This change allows a different version of the bundle
to be used than the default if a version isn't explicitly specified, there's
only one version downloaded, and it's been marked as a 'pinned-version' -
otherwise it reverts to the prior behavior.
2020-09-22 14:38:27 +01: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 217483dfd6 Convert rest of the actions 2020-08-26 16:20:36 +01:00
Esben Sparre Andreasen 9597f2e889 build typescript 2020-08-18 08:32:33 +02:00
Robert Brignull 0086c2ecdb use @actions/github 2020-07-06 16:25:26 +01:00
Robert Brignull c41d287cae Introduce wrapper around codeql 2020-07-02 14:25:08 +01:00