Compare commits

...

722 Commits

Author SHA1 Message Date
Stephan Brandauer
5e1b248936 for testing; don't merge this 2023-05-24 14:14:46 +00:00
Stephan Brandauer
636b9eab1d add rebuilt lib 2023-05-24 12:12:27 +00:00
Stephan Brandauer
153cab09da jsdoc for fixInvalidNotificationsInFile 2023-05-24 12:09:28 +00:00
Stephan Brandauer
dddabd0d26 add rebuilt lib 2023-05-24 11:51:57 +00:00
Stephan Brandauer
3100e1e354 move check to calling function
DISABLE_DUPLICATE_LOCATION_FIX - this is to avoid needless crashes on
large sarif files
2023-05-24 11:46:19 +00:00
Henry Mercer
1245696032 Merge pull request #1687 from github/henrymercer/update-changelog-note
Push back semver CodeQL bundles
2023-05-22 17:11:03 +01:00
Henry Mercer
317cd34a7a Push back semver CodeQL bundles
Push back the first bundle released using a semantic version number to 2.13.4 now that we're skipping 2.13.2.
2023-05-22 11:00:25 +01:00
Henry Mercer
6cfb483131 Merge pull request #1682 from github/henrymercer/semver-bundles
Extract semantic CLI version from URL when requesting specific tools
2023-05-18 11:32:45 +01:00
Henry Mercer
a5f4123fb0 Improve changelog note 2023-05-17 18:23:54 +01:00
Henry Mercer
50931b43dd Add changelog note 2023-05-17 14:57:27 +01:00
Henry Mercer
f54f0731d1 Merge branch 'main' into henrymercer/semver-bundles 2023-05-17 14:45:33 +01:00
Henry Mercer
ca6b925548 Merge pull request #1681 from github/henrymercer/remove-redundant-flag
Remove redundant query help version flag
2023-05-16 19:50:47 +01:00
Henry Mercer
d439786b65 Merge branch 'main' into henrymercer/remove-redundant-flag 2023-05-16 19:21:22 +01:00
Henry Mercer
f5159143cd Merge pull request #1680 from github/henrymercer/handle-swift-promotion
Use `resolve extractor` when finding autobuild scripts
2023-05-16 19:19:11 +01:00
Henry Mercer
a1be09ed8a Remove redundant query help version flag 2023-05-16 18:20:13 +01:00
Henry Mercer
2bf10dc4b9 Extract semantic CLI version from URL when requesting specific tools 2023-05-16 14:47:32 +01:00
Henry Mercer
e422b64793 Use resolve extractor when finding autobuild scripts 2023-05-16 11:18:16 +01:00
Rasmus Wriedt Larsen
5489416722 Merge pull request #1676 from github/rasmuswl/python-disable-dependency-installation
Feature flag to disable python dependency installation
2023-05-16 10:40:47 +02:00
Rasmus Wriedt Larsen
dc0f6da426 Update CHANGELOG.md
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-05-15 12:38:10 +02:00
Rasmus Wriedt Larsen
e1cca2565c Generate JS 2023-05-15 12:05:50 +02:00
Rasmus Wriedt Larsen
cf58ef4480 Update wording for CODEQL_PYTHON warning
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-05-15 12:05:03 +02:00
Rasmus Wriedt Larsen
fce87bbc67 Generate JS 2023-05-12 10:00:31 +02:00
Rasmus Wriedt Larsen
cc641561b7 Improve python warning message
The last dot in `=3.11.` is just slightly confusing, so added single
quotes around the environment variable assignments to make it 100% clear
2023-05-12 09:59:20 +02:00
Rasmus Wriedt Larsen
c237da1a2f Fix linting errors 2023-05-12 09:58:30 +02:00
Rasmus Wriedt Larsen
cbc79bf64b Merge branch 'main' into rasmuswl/python-disable-dependency-installation 2023-05-12 09:55:57 +02:00
Rasmus Wriedt Larsen
b8f39fe0f5 Use features properly in setupPythonExtractor 2023-05-12 09:55:22 +02:00
Henry Mercer
130884e4e1 Merge pull request #1675 from shaikhul/remove-consts
Remove MismatchedBranches check from code scanning workflow validation
2023-05-11 15:45:33 +01:00
Shaikhul Islam
a0755a79b6 Update CHANGELOG.md
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-05-11 10:22:57 -04:00
Shaikhul Islam
903cb278c5 recompile src 2023-05-11 14:16:34 +00:00
Shaikhul Islam
e5fdcd4a8f Apply suggestions from code review
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-05-11 09:29:25 -04:00
Rasmus Wriedt Larsen
eb8a70647a Update CHANGELOG.md 2023-05-11 12:18:29 +02:00
Rasmus Wriedt Larsen
0ccdbf8cd5 Feature flag to disable python dependency installation 2023-05-11 12:14:04 +02:00
Shaikhul Islam
c26fc558ba revert MissingPushHook checks changes 2023-05-10 20:37:56 +00:00
Shaikhul Islam
f8707c9939 update changelog 2023-05-10 15:01:33 +00:00
Shaikhul Islam
699855c048 fix linter issue 2023-05-09 15:05:36 +00:00
Shaikhul Islam
edb138ff88 remove consts MismatchedBranches and MissingPushHook 2023-05-09 14:39:49 +00:00
Andrew Eisenberg
95cfca769b Merge pull request #1673 from github/dependabot/github_actions/peter-evans/create-pull-request-5.0.1
Bump peter-evans/create-pull-request from 5.0.0 to 5.0.1
2023-05-08 12:25:32 -07:00
dependabot[bot]
9c51a58355 Bump peter-evans/create-pull-request from 5.0.0 to 5.0.1
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](5b4a9f6a9e...284f54f989)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 18:00:47 +00:00
Aditya Sharad
deb312c60b Merge pull request #1672 from github/aeisenberg/sarif-again
Fix broken regex
2023-05-05 12:53:12 -07:00
Andrew Eisenberg
9824588133 Fix broken regex
`($i)` is not valid for javascript regexes.
2023-05-05 12:02:19 -07:00
Andrew Eisenberg
11fba50273 Merge pull request #1668 from github/aeisenberg/update-sarif-schema 2023-05-05 09:14:24 -07:00
Andrew Eisenberg
684c4b5c77 Update CHANGELOG.md
Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
2023-05-05 08:41:11 -07:00
Dave Bartolomeo
1e1aca8165 Merge pull request #1670 from github/mergeback/v2.3.3-to-main-29b1f65c
Mergeback v2.3.3 refs/heads/releases/v2 into main
2023-05-04 15:27:32 -04:00
github-actions[bot]
898fba281b Update checked-in dependencies 2023-05-04 19:02:16 +00:00
github-actions[bot]
913b8b11ad Update changelog and version after v2.3.3 2023-05-04 18:53:44 +00:00
Dave Bartolomeo
29b1f65c5e Merge pull request #1669 from github/update-v2.3.3-318bcc7f8
Merge main into releases/v2
2023-05-04 14:52:14 -04:00
github-actions[bot]
140500d80a Update changelog for v2.3.3 2023-05-04 18:24:50 +00:00
Dave Bartolomeo
318bcc7f84 Merge pull request #1664 from github/update-bundle/codeql-bundle-20230428
Update default bundle to 2.13.1
2023-05-04 00:32:01 -04:00
Dave Bartolomeo
f72bf5dfb3 Fix workflow formatting 2023-05-03 21:43:47 -04:00
Dave Bartolomeo
33461954a5 Merge branch 'main' into update-bundle/codeql-bundle-20230428 2023-05-03 19:02:27 -04:00
Andrew Eisenberg
3df80238a3 Re-run sync.py with new ruamel.yaml 2023-05-02 15:19:05 -07:00
Andrew Eisenberg
ef88842204 Update jsonschema version
Fixes bug in `uniqueItems` property.
2023-05-02 14:26:17 -07:00
Andrew Eisenberg
ece3cbc8ec Update changelog 2023-05-02 13:52:28 -07:00
Andrew Eisenberg
febbadf751 Update the sarif schema file
The version we were using is quite old. Copied the latest from
123e95847b/Schemata/sarif-schema-2.1.0.json

I do not think the sarif spec will be changing any more without
an explicit version update, so this is fine for now.
2023-05-02 13:46:24 -07:00
Andrew Eisenberg
8ca5570701 Merge pull request #1666 from github/aeisenberg/readme-update
Add link to changenote for custom config
2023-05-01 15:07:45 -07:00
Andrew Eisenberg
b1b3d00b62 Add link to changenote for custom config
Also, use a better link in the readme.
2023-05-01 11:06:31 -07:00
Andrew Eisenberg
d2f6dfd52d Merge pull request #1665 from github/aeisenberg/config-param
Add new configuration Parameter
2023-05-01 10:26:31 -07:00
Andrew Eisenberg
cba5616040 Update CHANGELOG.md 2023-05-01 09:21:50 -07:00
github-actions[bot]
40c95932fe Add changelog note 2023-05-01 03:46:54 +00:00
github-actions[bot]
234badad23 Update default bundle to codeql-bundle-20230428 2023-05-01 03:46:50 +00:00
Andrew Eisenberg
824d18c689 Merge remote-tracking branch 'upstream/main' into issue-1589-config-param 2023-04-28 11:34:52 -07:00
Angela P Wen
f31a31c052 Merge pull request #1663 from github/mergeback/v2.3.2-to-main-f3feb00a
Mergeback v2.3.2 refs/heads/releases/v2 into main
2023-04-27 14:00:39 -07:00
github-actions[bot]
e3395de200 Update checked-in dependencies 2023-04-27 18:52:55 +00:00
github-actions[bot]
1cccbfcedc Update changelog and version after v2.3.2 2023-04-27 18:51:28 +00:00
Angela P Wen
f3feb00acb Merge pull request #1662 from github/update-v2.3.2-8b12d99ee
Merge main into releases/v2
2023-04-27 11:49:50 -07:00
github-actions[bot]
1c9e206df3 Update changelog for v2.3.2 2023-04-27 18:18:58 +00:00
Angela P Wen
8b12d99ee5 Fix bug where run attempt was reported as run ID (#1661) 2023-04-27 18:05:34 +00:00
Angela P Wen
dcf71cf79b Merge pull request #1660 from github/mergeback/v2.3.1-to-main-8662eabe
Mergeback v2.3.1 refs/heads/releases/v2 into main
2023-04-26 14:15:40 -07:00
github-actions[bot]
194450bdd6 Update checked-in dependencies 2023-04-26 20:48:31 +00:00
github-actions[bot]
e78ef455a8 Update changelog and version after v2.3.1 2023-04-26 20:44:18 +00:00
Angela P Wen
8662eabe0e Merge pull request #1659 from github/update-v2.3.1-da583b07a
* Update changelog and version after v2.3.0

* Update checked-in dependencies

* Throw full error for CLI bundle download (#1657)

* 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.

* Update changelog for v2.3.1

---------

Co-authored-by: github-actions[bot] <github-actions@github.com>
Co-authored-by: Chuan-kai Lin <cklin@github.com>
Co-authored-by: Angela P Wen <angelapwen@github.com>
2023-04-26 13:42:37 -07:00
github-actions[bot]
1f2f707d99 Update changelog for v2.3.1 2023-04-26 20:16:15 +00: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
Angela P Wen
a9648ea7c6 Throw full error for CLI bundle download (#1657) 2023-04-24 07:46:45 -07:00
Chuan-kai Lin
c5f3f016ae Merge pull request #1656 from github/mergeback/v2.3.0-to-main-b2c19fb9
Mergeback v2.3.0 refs/heads/releases/v2 into main
2023-04-21 12:43:38 -07:00
github-actions[bot]
90f053271e Update checked-in dependencies 2023-04-21 19:12:19 +00:00
github-actions[bot]
0f085f964c Update changelog and version after v2.3.0 2023-04-21 19:09:10 +00:00
Chuan-kai Lin
b2c19fb9a2 Merge pull request #1655 from github/update-v2.3.0-a8affb063
Merge main into releases/v2
2023-04-21 12:07:18 -07:00
github-actions[bot]
b203f98343 Update changelog for v2.3.0 2023-04-21 18:24:50 +00:00
Chuan-kai Lin
a8affb0639 Merge pull request #1649 from github/cklin/codeql-cli-2.13.0
Update default CodeQL bundle version to 2.13.0
2023-04-20 07:39:38 -07:00
Henry Mercer
b8cc643a23 Merge branch 'main' into cklin/codeql-cli-2.13.0 2023-04-20 11:23:25 +01:00
Henry Mercer
7019a9c6fd Merge pull request #1618 from github/henrymercer/remove-legacy-tracing
Remove legacy tracing
2023-04-20 11:22:32 +01:00
Henry Mercer
66f62df188 Merge branch 'main' into henrymercer/remove-legacy-tracing 2023-04-19 15:56:42 +01:00
Henry Mercer
afdf30f311 Merge pull request #1652 from github/henrymercer/fix-bundle-version
Fix the `bundleVersion` field set by the automated bundle update PR
2023-04-18 21:04:26 +01:00
Henry Mercer
55a2e70992 Autoformat index.ts 2023-04-18 18:59:36 +01:00
Henry Mercer
1c2f282107 Fix bundle version
It's the whole tag, we don't want to remove the `codeql-bundle-` prefix.
2023-04-18 18:59:09 +01:00
tgrall
47cec7ab01 add test with config file and input together 2023-04-18 06:01:33 +02:00
tgrall
7b876ae4f4 remove space from json string 2023-04-18 05:46:51 +02:00
tgrall
f398a65921 fix after review from @henrymercer 2023-04-18 05:43:21 +02:00
dependabot[bot]
9a866ed452 Bump swift-actions/setup-swift in /.github/actions/setup-swift (#1650)
Bumps [swift-actions/setup-swift](https://github.com/swift-actions/setup-swift) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/swift-actions/setup-swift/releases)
- [Commits](da0e3e04b5...65540b95f5)

---
updated-dependencies:
- dependency-name: swift-actions/setup-swift
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-17 19:16:10 +00:00
Chuan-kai Lin
7867d03591 Update default CodeQL bundle version to 2.13.0 2023-04-14 15:28:21 -07:00
Chuan-kai Lin
be2b53b5c7 Merge pull request #1648 from github/cklin/update-bundle-trigger
Fix pre-release trigger for update-bundle action
2023-04-14 15:11:42 -07:00
Chuan-kai Lin
ae24b75fca Fix pre-release trigger for update-bundle action
This PR switches the update-bundle release trigger from `prereleased` to `published` because the former has been documented not to work.

From https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release:

> Note: The prereleased type will not trigger for pre-releases published from draft releases, but the published type will trigger. If you want a workflow to run when stable and pre-releases publish, subscribe to published instead of released and prereleased.
2023-04-14 14:50:37 -07:00
Henry Mercer
dc046388f3 Merge pull request #1647 from github/mergeback/v2.2.12-to-main-7df0ce34
Mergeback v2.2.12 refs/heads/releases/v2 into main
2023-04-13 17:23:16 +01:00
github-actions[bot]
b4fa971e40 Update checked-in dependencies 2023-04-13 15:50:19 +00:00
github-actions[bot]
7879209bb2 Update changelog and version after v2.2.12 2023-04-13 14:03:50 +00:00
Henry Mercer
7df0ce3489 Merge pull request #1646 from github/update-v2.2.12-d944b3423
Merge main into releases/v2
2023-04-13 15:01:19 +01:00
github-actions[bot]
fbedecac34 Update changelog for v2.2.12 2023-04-13 11:35:13 +00:00
Henry Mercer
d944b3423d Merge pull request #1619 from github/henrymercer/default-setup-workflow
Allow workflow to be passed via an environment variable for default setup
2023-04-13 10:17:54 +01:00
Henry Mercer
e3210d8ce3 Add changelog note 2023-04-12 19:18:17 +01:00
Henry Mercer
599f4927f2 Allow passing the workflow via an environment variable 2023-04-12 14:14:43 +01:00
Henry Mercer
ed6c4995fc Merge pull request #1645 from github/henrymercer/remove-dependencies
Remove unused dependencies
2023-04-11 16:27:15 +01:00
Henry Mercer
c2b5d643fd Require xml2js >=0.5.0 to address CVE-2023-0842 2023-04-11 13:33:36 +01:00
Henry Mercer
8a093aa1a5 Merge branch 'main' into henrymercer/remove-legacy-tracing 2023-04-11 12:25:45 +01:00
Henry Mercer
9c13316a15 Remove unused dependencies 2023-04-11 12:17:38 +01:00
Angela P Wen
98f7bbd610 Add workflow_run_attempt data to status report (#1640) 2023-04-10 20:02:23 +00:00
dependabot[bot]
d7b9dcdb85 Bump peter-evans/create-pull-request from 4.2.4 to 5.0.0 (#1643)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4.2.4 to 5.0.0.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](38e0b6e68b...5b4a9f6a9e)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-10 11:27:05 -07:00
tgrall
fc374f5e9a remove the documentation about workflow parameters 2023-04-10 07:59:26 +02:00
tgrall
b4e6f81a72 resolve comments from @henrymercer 2023-04-10 07:56:09 +02:00
Tugdual Grall
0b75f471b1 Update CHANGELOG.md : during PR Review
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-04-10 07:38:51 +02:00
Tugdual Grall
c9f360d9af Update README.md : during PR Review
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-04-10 07:38:31 +02:00
Tugdual Grall
d2950c11f0 Update README.md : during PR Review
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-04-10 07:37:52 +02:00
Tugdual Grall
a9fb7d923c Update init/action.yml : PR review
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-04-10 07:37:20 +02:00
Tugdual Grall
696504dcab Accept change in PR
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-04-10 07:35:57 +02:00
Tugdual Grall
18f13455eb Merge branch 'main' into issue-1589-config-param 2023-04-10 07:33:09 +02:00
Henry Mercer
988e1bc941 Merge pull request #1639 from github/mergeback/v2.2.11-to-main-d186a2a3
Mergeback v2.2.11 refs/heads/releases/v2 into main
2023-04-06 19:20:52 +01:00
github-actions[bot]
e12fed6a79 Update checked-in dependencies 2023-04-06 17:58:48 +00:00
github-actions[bot]
ca89579b06 Update changelog and version after v2.2.11 2023-04-06 17:31:29 +00:00
Henry Mercer
d186a2a36c Merge pull request #1638 from github/update-v2.2.11-518b24fea
Merge main into releases/v2
2023-04-06 18:29:23 +01:00
github-actions[bot]
748f83eaab Update changelog for v2.2.11 2023-04-06 17:08:10 +00:00
Henry Mercer
518b24fea4 Merge pull request #1637 from github/henrymercer/fix-init-exception-reporting
Report exceptions to telemetry in init Action
2023-04-06 17:57:29 +01:00
Henry Mercer
69371ffa95 Merge branch 'main' into henrymercer/fix-init-exception-reporting 2023-04-06 17:05:02 +01:00
Henry Mercer
e5c2f32a9f Consistently wrap errors 2023-04-06 17:04:21 +01:00
Henry Mercer
c28edf06a1 Merge pull request #1636 from github/henrymercer/re-enable-duplicate-sarif-workaround
Re-enable duplicate SARIF notification location workaround
2023-04-06 16:45:06 +01:00
Henry Mercer
555b602b2f Report exceptions to telemetry in init Action 2023-04-06 15:08:48 +01:00
Henry Mercer
7193623f40 Re-enable duplicate SARIF notification location workaround 2023-04-06 14:48:04 +01:00
Henry Mercer
2058418de9 Don't expect Swift baseline info on Windows 2023-04-05 20:41:23 +01:00
Henry Mercer
5da64f56c0 Set up Swift in unset environment workflow 2023-04-05 20:27:02 +01:00
Henry Mercer
322cea6439 Set up Swift in local bundle workflow 2023-04-05 19:31:20 +01:00
Henry Mercer
f7a67e4341 Merge branch 'main' into henrymercer/remove-legacy-tracing 2023-04-05 18:39:27 +01:00
Alexander Eyers-Taylor
f32426ba96 Merge pull request #1635 from github/mergeback/v2.2.10-to-main-8c8d71dd
Mergeback v2.2.10 refs/heads/releases/v2 into main
2023-04-05 18:13:33 +01:00
github-actions[bot]
173a94ca3f Update checked-in dependencies 2023-04-05 16:53:56 +00:00
github-actions[bot]
8efbd5b301 Update changelog and version after v2.2.10 2023-04-05 16:15:52 +00:00
Alexander Eyers-Taylor
8c8d71dde4 Merge pull request #1634 from github/update-v2.2.10-66aeadb4c
Merge main into releases/v2
2023-04-05 17:13:56 +01:00
github-actions[bot]
d53297ef61 Update changelog for v2.2.10 2023-04-05 15:35:01 +00:00
Henry Mercer
66aeadb4c9 Merge pull request #1631 from github/henrymercer/duplicate-diagnostics-fixed-in-cli
Skip the SARIF notification object workaround for CLIs that have fixed this bug
2023-04-05 10:46:12 +01:00
Andrew Eisenberg
fa7cce4d4b Merge pull request #1632 from github/aeisenberg/codeql-testing-org
Move to the codeql-testing org
2023-04-04 14:38:19 -07:00
Andrew Eisenberg
2754e10472 Move to the codeql-testing org
Refer to the packages in codeql-testing, not in dsp-testing.
2023-04-04 13:39:56 -07:00
Henry Mercer
3bba073180 Skip the SARIF notification object workaround for fixed CLIs 2023-04-04 18:19:05 +01:00
Alexander Eyers-Taylor
ae0109a777 Merge pull request #1629 from github/alexet/update-2.12.6-2
Update default CodeQL bundle version to 2.12.6
2023-04-04 16:32:13 +01:00
Alexander Eyers-Taylor
9c869ebf0d Update default CodeQL bundle version to 2.12.6 2023-04-04 16:01:04 +01:00
Henry Mercer
f0a422fa27 Merge pull request #1630 from github/henrymercer/automate-bundle-upgrade
Automate the bundle upgrade
2023-04-03 20:07:03 +01:00
Henry Mercer
98173be3f0 Add a comment about lib/defaults.json 2023-04-03 19:39:22 +01:00
Henry Mercer
f6091a09eb Use tee when setting env vars to improve debugging 2023-04-03 19:34:20 +01:00
Henry Mercer
a86046f817 Explain CLI version marker files 2023-04-03 19:32:03 +01:00
Henry Mercer
33f30874a7 Format .github/actions/update-bundle/index.ts 2023-04-03 19:30:07 +01:00
Henry Mercer
1c0a788663 Add workflow to automatically update the bundle 2023-04-03 19:10:01 +01:00
Henry Mercer
e85546ccca Move internal Actions into .github/actions
This is a more standard location for these custom Actions.
2023-04-03 18:29:29 +01:00
tgrall
fe4a785361 rename new parameter from configuration to config 2023-04-01 07:13:01 +02:00
Henry Mercer
bb28e7e59e Merge pull request #1626 from github/henrymercer/diagnostics-ghes
Enable diagnostics functionality on GHES
2023-03-30 10:22:39 +01:00
Henry Mercer
69aec345f1 Pass negative SARIF include diagnostics flag when feature is disabled
In preparation for enabling this flag by default in the CLI
2023-03-29 18:56:19 +01:00
Henry Mercer
29a4713933 Enable diagnostics functionality on GHES 2023-03-29 18:45:27 +01:00
Henry Mercer
d838bacfbe Simplify matrix 2023-03-29 15:48:13 +01:00
Robin Neatherway
dc81ae3368 Merge pull request #1625 from github/rneatherway/rm-old-checks
Remove checks for triggering on specific paths
2023-03-29 13:28:57 +01:00
Henry Mercer
72d018e267 Improve serialization of Swift environment variable if expression 2023-03-29 13:15:59 +01:00
Henry Mercer
9975b733f4 Fix bundle version comments 2023-03-29 13:03:45 +01:00
Henry Mercer
6cd5121600 Merge branch 'main' into henrymercer/remove-legacy-tracing 2023-03-29 13:03:14 +01:00
Robin Neatherway
f6e4cff38a Remove checks for triggering on specific paths
These are no longer necessary with the new approach to selecting
alerts to show on pull requests.
2023-03-29 11:02:16 +02:00
Henry Mercer
fff3a80b5b Merge pull request #1620 from github/henrymercer/disable-flaky-check
Disable flaky Swift autobuild checks
2023-03-28 21:01:11 +01:00
Henry Mercer
ff39eb8d6a Disable flaky Swift autobuild checks 2023-03-28 20:40:23 +01:00
Henry Mercer
6ef37003ca Update CodeQL releases used in PR checks 2023-03-28 20:07:09 +01:00
Henry Mercer
d13d683355 Bump minor version number and add changelog note 2023-03-28 18:53:47 +01:00
Henry Mercer
d8fe76e161 Delete legacy tracing 2023-03-28 18:53:43 +01:00
Henry Mercer
4772c1d99f Bump minimum version to 2.8.5 2023-03-28 17:24:45 +01:00
Andrew Eisenberg
f9c159f4fd Merge pull request #1613 from github/aeisenberg/codeql-testing
Use new location for external queries
2023-03-27 17:35:01 -07:00
Andrew Eisenberg
0af0653ef4 Use new location for external queries
They have moved from `dsp-testing` to `codeql-testing`.
2023-03-27 16:11:45 -07:00
Henry Mercer
bc0ed6a6c3 Merge pull request #1610 from github/henrymercer/diagnostics-workaround-improvements
Follow-up improvements to the diagnostics workaround
2023-03-27 17:12:07 +01:00
Henry Mercer
b0e191ecbc Merge pull request #1609 from github/mergeback/v2.2.9-to-main-04df1262
Mergeback v2.2.9 refs/heads/releases/v2 into main
2023-03-27 16:42:07 +01:00
Henry Mercer
57eca7cbb2 Use Array.isArray 2023-03-27 15:59:29 +01:00
Henry Mercer
1e7a38893c Wrap reading and writing SARIF files 2023-03-27 15:44:47 +01:00
github-actions[bot]
2deae45400 Update checked-in dependencies 2023-03-27 14:03:17 +00:00
github-actions[bot]
32daed70e7 Update changelog and version after v2.2.9 2023-03-27 13:41:15 +00:00
Henry Mercer
04df1262e6 Merge pull request #1608 from github/update-v2.2.9-fb32c3fef
Merge main into releases/v2
2023-03-27 14:36:30 +01:00
Henry Mercer
f0988cbd79 Move changelog note to correct section 2023-03-27 11:57:26 +01:00
github-actions[bot]
fef20d6c35 Update changelog for v2.2.9 2023-03-27 10:53:14 +00:00
Henry Mercer
fb32c3fefd Merge pull request #1605 from github/henrymercer/diagnostics-grouping-workaround
Work around duplicate locations bug in diagnostics export
2023-03-27 11:43:33 +01:00
Henry Mercer
329c022f48 Just check the number of locations
Only tests the property we are looking for and avoids problems with
different cross-platform behavior.
2023-03-24 21:50:26 +00:00
Henry Mercer
c8935d5a9d Remove duplicate locations from failed run SARIF 2023-03-24 20:30:57 +00:00
Henry Mercer
ade432fd68 Remove duplicate locations from output of database interpret-results 2023-03-24 20:30:57 +00:00
Henry Mercer
6f852eeb38 Implement removing duplicate locations from a SARIF file 2023-03-24 20:30:57 +00:00
Henry Mercer
097ab4665f Speed up checks a bit by just running the standard suite 2023-03-24 20:30:57 +00:00
Henry Mercer
befd804b8b Extend diagnostics export integration test to capture location bug 2023-03-24 19:48:36 +00:00
Angela P Wen
a21bb7f968 Update upload input values and logic (#1598)
- The `upload` input to the `analyze` Action now accepts the following values:
    - `always` is the default value, which uploads the SARIF file to Code Scanning for successful and failed runs.
    - `failure-only` is recommended for customers post-processing the SARIF file before uploading it to Code Scanning. This option uploads debugging information to Code Scanning for failed runs to improve the debugging experience.
    - `never` avoids uploading the SARIF file to Code Scanning even if the code scanning run fails. This is not recommended for external users since it complicates debugging.
    - The legacy `true` and `false` options will be interpreted as `always` and `failure-only` respectively.

---------

Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-03-23 17:23:25 +00:00
Charis Kyriakou
0214d1d378 Merge pull request #1603 from github/charisk/default-branch-analayzing-override
Add override for code scanning analysis of default branch
2023-03-23 14:21:05 +00:00
Charis Kyriakou
94cc1dea00 Add override for code scanning analysis of default branch 2023-03-23 13:31:00 +00:00
Henry Mercer
04f256d7e2 Merge pull request #1602 from github/mergeback/v2.2.8-to-main-67a35a08
Mergeback v2.2.8 refs/heads/releases/v2 into main
2023-03-22 19:48:28 +00:00
github-actions[bot]
0b08c9f2ff Update checked-in dependencies 2023-03-22 19:14:19 +00:00
github-actions[bot]
1196b1ac0c Update changelog and version after v2.2.8 2023-03-22 19:04:40 +00:00
Henry Mercer
67a35a0858 Merge pull request #1601 from github/update-v2.2.8-066b6343e
Merge main into releases/v2
2023-03-22 19:02:35 +00:00
github-actions[bot]
57571ab0cd Update changelog for v2.2.8 2023-03-22 18:32:36 +00:00
Henry Mercer
066b6343ef Merge pull request #1599 from github/update-supported-enterprise-server-versions
Update supported GitHub Enterprise Server versions.
2023-03-22 18:26:37 +00:00
Robin Neatherway
aefd9896b1 Merge pull request #1597 from github/rneatherway/ghe-dotcom
Account for versioning of ghe.com
2023-03-22 17:21:10 +00:00
Robin Neatherway
3ca2260643 Account for versioning of ghe.com 2023-03-22 16:47:23 +00:00
GitHub
5f20b2c372 Update supported GitHub Enterprise Server versions. 2023-03-22 00:10:22 +00:00
Angela P Wen
760583e70d Bump setup-go from v3 to v4 (#1595)
* Bump actions/setup-go from 3 to 4

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update autogenerated workflows

* Bump setup-go from v3 to v4

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 10:22:27 -07:00
Henry Mercer
0ef7eda548 Merge pull request #1585 from github/henrymercer/bundle-2.12.5
Update default bundle version to 2.12.5
2023-03-21 14:59:16 +00:00
Henry Mercer
86128131fa Merge branch 'main' into henrymercer/bundle-2.12.5 2023-03-21 12:18:07 +00:00
Henry Mercer
ebbe965b43 Merge pull request #1588 from github/update-supported-enterprise-server-versions
Update supported GitHub Enterprise Server versions.
2023-03-21 00:04:32 +00:00
Angela P Wen
3cbd063679 Upload per-database diagnostic SARIFs on green and red runs (#1556)
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-03-20 21:09:04 +00:00
dependabot[bot]
b4fba292aa Bump typescript from 4.9.4 to 5.0.2 (#1592)
* Bump typescript from 4.9.4 to 5.0.2

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.4 to 5.0.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.9.4...v5.0.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

* Bump @typescript-eslint/parser for TS 5 compat

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions@github.com>
Co-authored-by: Henry Mercer <henrymercer@github.com>
2023-03-20 13:32:50 -07:00
dependabot[bot]
b55762b0a6 Bump actions/setup-go from 3 to 4 (#1593)
* Bump actions/setup-go from 3 to 4

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update autogenerated workflows

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Angela P Wen <angelapwen@github.com>
2023-03-20 13:31:56 -07:00
dependabot[bot]
91fb7b5c11 Bump peter-evans/create-pull-request from 4.2.3 to 4.2.4 (#1594)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4.2.3 to 4.2.4.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](2b011faafd...38e0b6e68b)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 11:57:08 -07:00
Tugdual Grall
34231cfd52 fix CI failure - check js 2023-03-18 16:51:49 +00:00
Tugdual Grall
f1fb80a041 Update README.md 2023-03-18 16:17:44 +01:00
Tugdual Grall
f81f52702f Update README.md - typo 2023-03-18 16:17:16 +01:00
Tugdual Grall
2f141340f0 fix linter issues 2023-03-18 15:14:34 +00:00
Tugdual Grall
94786b354b update changelog 2023-03-18 13:48:45 +00:00
Tugdual Grall
ee44252240 - Add new configuration Parameter
- Write test to check it is read from configuration
- Update documentation
2023-03-18 13:40:54 +00:00
GitHub
978bc50f9b Update supported GitHub Enterprise Server versions. 2023-03-18 00:11:16 +00:00
Henry Mercer
fb75ebd750 Merge pull request #1586 from github/henrymercer/enterprise-releases-ignore-classic-version
Ignore classic GHES version when updating supported versions
2023-03-17 18:03:36 +00:00
Henry Mercer
a2527628e8 Add a workflow_dispatch trigger 2023-03-17 13:54:10 +00:00
Henry Mercer
16b3d998b4 Ignore classic GHES version when updating supported versions 2023-03-17 13:53:24 +00:00
Henry Mercer
98a90dcce7 Update default bundle version to 2.12.5 2023-03-17 13:42:17 +00:00
Henry Mercer
d23060145b Merge pull request #1582 from github/mergeback/v2.2.7-to-main-168b99b3
Mergeback v2.2.7 refs/heads/releases/v2 into main
2023-03-15 12:15:14 +00:00
github-actions[bot]
bd8fec7f9f Update checked-in dependencies 2023-03-15 11:51:19 +00:00
github-actions[bot]
6a8522e57e Update changelog and version after v2.2.7 2023-03-15 11:44:17 +00:00
Henry Mercer
168b99b3c2 Merge pull request #1581 from github/update-v2.2.7-433fe88bf
Merge main into releases/v2
2023-03-15 11:42:20 +00:00
github-actions[bot]
bc7318da91 Update changelog for v2.2.7 2023-03-15 10:39:32 +00:00
Andrew Eisenberg
433fe88bf3 Merge pull request #1579 from github/aeisenberg/no-upload-database
Avoid uploading databases after integration tests
2023-03-14 15:39:16 -07:00
Andrew Eisenberg
c208575433 Avoid uploading databases after integration tests
We are still getting coverage of the upload capability through the
standard codeql analysis workflow.
2023-03-14 14:55:58 -07:00
Henry Mercer
b8ea587211 Merge pull request #1578 from github/henrymercer/fix-circular-dependency
Fix a circular dependency that led a minimum version to be `undefined`
2023-03-14 21:31:47 +00:00
Henry Mercer
65f42e3768 Inline minimum version number to avoid circular dependency 2023-03-14 21:04:34 +00:00
Henry Mercer
d9ceda3823 Add debug logging for feature flag enablement 2023-03-14 20:57:55 +00:00
dependabot[bot]
19f00dc212 Bump @ava/typescript from 3.0.1 to 4.0.0 (#1576)
* Bump @ava/typescript from 3.0.1 to 4.0.0

Bumps [@ava/typescript](https://github.com/avajs/typescript) from 3.0.1 to 4.0.0.
- [Release notes](https://github.com/avajs/typescript/releases)
- [Commits](https://github.com/avajs/typescript/compare/v3.0.1...v4.0.0)

---
updated-dependencies:
- dependency-name: "@ava/typescript"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions@github.com>
2023-03-13 14:10:40 -07:00
Henry Mercer
ec298233c1 Merge pull request #1565 from github/henrymercer/diagnostics-code-scanning-config
Export configuration information to SARIF
2023-03-13 16:44:23 +00:00
Henry Mercer
a92a14621b Prefer core.info to console.log 2023-03-13 12:45:15 +00:00
Dave Bartolomeo
204eadab9d Merge pull request #1571 from github/mergeback/v2.2.6-to-main-16964e90
Mergeback v2.2.6 refs/heads/releases/v2 into main
2023-03-12 10:03:48 -04:00
github-actions[bot]
0e50a19ce3 Update checked-in dependencies 2023-03-12 13:39:54 +00:00
github-actions[bot]
4775eab92e Update changelog and version after v2.2.6 2023-03-10 18:11:39 +00:00
Dave Bartolomeo
16964e90ba Merge pull request #1570 from github/update-v2.2.6-e12a2ecd4
Merge main into releases/v2
2023-03-10 13:08:52 -05:00
github-actions[bot]
74cbab4958 Update changelog for v2.2.6 2023-03-10 15:48:11 +00:00
Henry Mercer
b36480d849 Specify SARIF path via env variable 2023-03-09 19:24:49 +00:00
Henry Mercer
53f80edaf6 Merge branch 'main' into henrymercer/diagnostics-code-scanning-config 2023-03-09 18:47:43 +00:00
Henry Mercer
b31d983f22 Add PR check 2023-03-09 18:37:44 +00:00
Henry Mercer
485cc11a24 Rename featureEnablement to features
This is more succinct and removes a few line breaks
2023-03-09 16:46:51 +00:00
Henry Mercer
fc1366f6ec Gate config export behind a feature flag 2023-03-09 16:44:45 +00:00
Dave Bartolomeo
e12a2ecd45 Merge pull request #1561 from github/dbartol/bundle-2.12.4
Update bundle to 2.12.4
2023-03-09 10:22:39 -05:00
Dave Bartolomeo
d47d4c8047 Merge branch 'main' into dbartol/bundle-2.12.4 2023-03-09 09:45:34 -05:00
Andrew Eisenberg
f13b180fb8 Merge pull request #1567 from github/aeisenberg/config-parsing-ghes
Add default values to feature flags
2023-03-08 09:44:44 -08:00
Angela P Wen
a3cf96418e Add security-experimental to codeql-config.yml (#1566) 2023-03-08 08:39:00 -08:00
Andrew Eisenberg
0c27d0da4a Add default values to feature flags
This changes adds default values to feature flags. These default values
will be used whenever the full set of feature flags are not available
(for example on GHES or if the flag request fails).

The goal is to enable cli config parsing on GHES without removing the
feature flag on dotcom.
2023-03-07 16:24:55 -08:00
Henry Mercer
4b1f530308 Export configuration information for green runs 2023-03-07 21:22:43 +00:00
Henry Mercer
d98eadb536 Export configuration information for red runs 2023-03-07 21:21:47 +00:00
Andrew Eisenberg
e4b846c482 Merge pull request #1564 from github/aeisenberg/qlconfig-file
Fix --qlconfig-file option
2023-03-07 13:15:20 -08:00
Henry Mercer
c310f094dd Fix name of qlconfig file argument 2023-03-07 08:46:58 -08:00
Henry Mercer
4366485427 Avoid passing an undefined qlconfig arg 2023-03-07 08:46:57 -08:00
Henry Mercer
8340258886 Avoid writing user-config.yaml file while running tests 2023-03-07 08:46:57 -08:00
Henry Mercer
6ef6e50882 Merge pull request #1563 from github/dependabot/npm_and_yarn/glob-9.2.1
Bump glob from 8.0.1 to 9.2.1
2023-03-06 17:02:10 +00:00
Henry Mercer
eb40427b00 Fix name of qlconfig file argument 2023-03-06 10:48:14 +00:00
github-actions[bot]
7806af3040 Update checked-in dependencies 2023-03-06 10:44:50 +00:00
dependabot[bot]
abf1cea835 Bump glob from 8.0.1 to 9.2.1
Bumps [glob](https://github.com/isaacs/node-glob) from 8.0.1 to 9.2.1.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v8.0.1...v9.2.1)

---
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 10:36:27 +00:00
Henry Mercer
e5ade42937 Merge branch 'main' into dbartol/bundle-2.12.4 2023-03-06 10:33:06 +00:00
Angela P Wen
6f079be771 Bump setup-swift and re-configure dependabot (#1560)
* Update `setup-swift` to v1.22.0

* Configure dependabot to scan `setup-swift` dir

* Add reminder to manually update the SHA in CLI test

* Add comment on new Dependabot directory
2023-03-06 10:32:10 +00:00
Henry Mercer
100bd7bbef Avoid passing an undefined qlconfig arg 2023-03-06 10:26:34 +00:00
Henry Mercer
a6d3a44519 Avoid writing user-config.yaml file while running tests 2023-03-06 10:23:28 +00:00
Dave Bartolomeo
5e4af3a25d Update bundle to 2.12.4 2023-03-05 20:52:06 -05:00
Dave Bartolomeo
e812e63bb6 Update bundle to 2.12.4 2023-03-05 20:50:59 -05:00
Andrew Eisenberg
a589d4087e Merge pull request #1527 from github/aeisenberg/qlconfig-in-cli
Ensure qlconfig file is created when config parsing in cli is on
2023-02-27 10:26:08 -08:00
Andrew Eisenberg
98d24e5629 Address comments from PR 2023-02-27 09:59:16 -08:00
Henry Mercer
903be79953 Merge pull request #1548 from github/mergeback/v2.2.5-to-main-32dc4993
Mergeback v2.2.5 refs/heads/releases/v2 into main
2023-02-27 11:02:00 +00:00
github-actions[bot]
18ff14b615 Update checked-in dependencies 2023-02-27 09:35:51 +00:00
Henry Mercer
36a249f5ae Merge branch 'main' into mergeback/v2.2.5-to-main-32dc4993 2023-02-27 09:33:05 +00:00
Henry Mercer
041757fc59 Merge pull request #1549 from github/henrymercer/fix-update-dependencies
Fix workflow to update dependencies
2023-02-27 09:11:46 +00:00
Andrew Eisenberg
8f19113f88 Merge branch 'main' into aeisenberg/qlconfig-in-cli 2023-02-26 18:35:21 -08:00
Henry Mercer
cf1855ae37 Fix workflow to update dependencies
Port over the fix from
https://github.com/github/codeql-action/pull/1544
and share code so these scripts don't get out of sync again.
2023-02-24 20:25:21 +00:00
github-actions[bot]
652709d1b9 Update changelog and version after v2.2.5 2023-02-24 19:28:26 +00:00
Henry Mercer
32dc499307 Merge pull request #1547 from github/update-v2.2.5-237a258d2
Merge main into releases/v2
2023-02-24 19:26:08 +00:00
github-actions[bot]
b742728ac2 Update changelog for v2.2.5 2023-02-24 19:01:14 +00:00
Alexander Eyers-Taylor
237a258d2b Merge pull request #1543 from github/alexet/update-2.12.3
Update default CodeQL bundle version to 2.12.3
2023-02-23 15:46:39 +00:00
Alexander Eyers-Taylor
5972e6d72e Fix lib file 2023-02-22 18:38:46 +00:00
Alexander Eyers-Taylor
164027e682 Fix bundle versions 2023-02-22 18:18:37 +00:00
Andrew Eisenberg
736263f8fe Update src/codeql.ts 2023-02-17 13:22:25 -08:00
Chuan-kai Lin
3dde1f3512 Merge pull request #1540 from cklin/expect-discarded-cache
Set --expect-discarded-cache option
2023-02-17 12:36:05 -08:00
Chuan-kai Lin
d7d7567b0e Unit tests for optimizeForLastQueryRun 2023-02-17 11:19:38 -08:00
Chuan-kai Lin
0e4e857bab Set optimizeForLastQueryRun on last run 2023-02-17 11:17:42 -08:00
Chuan-kai Lin
08d1f21d4f Calculate customQueryIndices early
This refactoring commit changes runQueries() to calculate the set of
indices with non-empty custom queries early. Doing so allows us to check
early on whether there are any custom queries to run.
2023-02-17 11:14:08 -08:00
Andrew Eisenberg
f3bd25eefa Merge pull request #1544 from github/aeisenberg/clean-cache
Clean the npm cache before running install
2023-02-17 10:50:03 -08:00
Andrew Eisenberg
41f1810e52 Clean the npm cache before running install 2023-02-17 09:54:53 -08:00
Alexander Eyers-Taylor
d87ad69338 Update default CodeQL bundle version to 2.12.3 2023-02-17 15:49:39 +00:00
Chuan-kai Lin
8242edb8ed databaseRunQueries(): add optimizeForLastQueryRun parameter 2023-02-15 08:45:13 -08:00
Chuan-kai Lin
3095a09bb0 databaseRunQueries(): accept a list of flags
This refactoring commit changes databaseRunQueries() to accept a list of
flags instead of separate memory and threads flags.
2023-02-14 11:53:52 -08:00
Andrew Eisenberg
e00cd12e3e Merge pull request #1539 from github/aeisenberg/unref-delay
Avoid unref-ing timer while awaiting status upload
2023-02-13 15:24:43 -08:00
Angela P Wen
a25536bc80 Optionally send tools download telemetry (#1538) 2023-02-13 21:45:54 +00:00
Andrew Eisenberg
a2487fb969 Avoid unref-ing timer while awaiting status upload
We had a problem where `waitForProcessing` was not completing before
the node process ends. This is because using `unref` would allow the
node process to end without having the `delay` function complete.
2023-02-13 13:43:18 -08:00
Chuan-kai Lin
e187d074ed Merge pull request #1533 from cklin/trap-caching-feature-flag
Remove TRAP caching feature flag
2023-02-13 06:25:11 -08:00
Angela P Wen
89c5165e5a Remove v1 from release docs (#1536) 2023-02-10 12:40:45 -08:00
Angela P Wen
ba216f7d34 Merge pull request #1535 from github/mergeback/v2.2.4-to-main-17573ee1
Mergeback v2.2.4 refs/heads/releases/v2 into main
2023-02-10 10:57:09 -08:00
github-actions[bot]
68f4f0d3bb Update checked-in dependencies 2023-02-10 18:30:00 +00:00
github-actions[bot]
12d9a244fa Update changelog and version after v2.2.4 2023-02-10 18:23:25 +00:00
Angela P Wen
17573ee1cc Merge pull request #1534 from github/update-v2.2.4-40babc141
Merge main into releases/v2
2023-02-10 10:20:44 -08:00
github-actions[bot]
b6975b4b1a Update changelog for v2.2.4 2023-02-10 17:42:05 +00:00
Chuan-kai Lin
b011dbdedf Remove TRAP caching feature flag 2023-02-10 09:27:16 -08:00
Angela P Wen
40babc141f Tools telemetry: accurately report when feature flags were inaccessible (#1532)
* Cache whether feature flags are accessible

* Small comment fixup from linting change
2023-02-10 09:06:43 -08:00
Andrew Eisenberg
5492b7d104 Add tests for generateRegistries with an existing CODEQL_REGISTRIES_AUTH 2023-02-09 13:37:08 -08:00
Andrew Eisenberg
3c81243bb1 Apply suggestions from code review
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-02-09 12:25:33 -08:00
Andrew Eisenberg
e2f72f11e4 Merge remote-tracking branch 'upstream/main' into aeisenberg/qlconfig-in-cli 2023-02-09 09:47:43 -08:00
Chuan-kai Lin
7ba5ed7eed Merge pull request #1531 from github/mergeback/v2.2.3-to-main-8775e868
Mergeback v2.2.3 refs/heads/releases/v2 into main
2023-02-08 13:06:40 -08:00
github-actions[bot]
21f3020df6 Update checked-in dependencies 2023-02-08 20:40:37 +00:00
github-actions[bot]
b872c5adfd Update changelog and version after v2.2.3 2023-02-08 20:37:07 +00:00
Chuan-kai Lin
8775e86802 Merge pull request #1530 from github/update-v2.2.3-c4e22e9fc
Merge main into releases/v2
2023-02-08 12:35:06 -08:00
github-actions[bot]
a2ad80b966 Update changelog for v2.2.3 2023-02-08 19:08:32 +00:00
Henry Mercer
c4e22e9fce Merge pull request #1529 from github/henrymercer/remove-bypass-toolcache-flags
Remove feature flags for bypassing the toolcache
2023-02-08 18:13:01 +00:00
Henry Mercer
db534af2ae Remove feature flags for bypassing the toolcache
- We can now use the default bundle version feature flags to remediate a
bad bundle update.
- Controlled switchover ensures that a repo consistently gets the same
bundle version, so we no longer have alert churn concerns with Kotlin
and Swift.
2023-02-08 15:20:51 +00:00
Andrew Eisenberg
bbe8d375fd Ensure qlconfig file is created when config parsing in cli is on
Previously, with the config parsing in the cli feature flag turned on,
the CLI was not able to download packs from other registries. This PR
adds the codeql-action changes required for this. The CLI changes will
be in a separate, internal PR.
2023-02-07 10:40:56 -08:00
Chuan-kai Lin
4369dda4ae Merge pull request #1518 from github/cklin/codeql-cli-2.12.2
Bump default CodeQL version to 2.12.2
2023-02-07 10:27:54 -08:00
Chuan-kai Lin
4f08c2cf20 Bump default CodeQL version to 2.12.2 2023-02-07 08:10:01 -08:00
Angela P Wen
81644f35ff Add max line length of 120 to linter (#1524) 2023-02-07 14:09:33 +00:00
Henry Mercer
9ab6aa64a0 Merge pull request #1526 from github/mergeback/v2.2.2-to-main-39d8d7e7
Mergeback v2.2.2 refs/heads/releases/v2 into main
2023-02-06 20:23:48 +00:00
github-actions[bot]
256973e279 Update checked-in dependencies 2023-02-06 20:02:57 +00:00
github-actions[bot]
59b25b480f Update changelog and version after v2.2.2 2023-02-06 19:48:14 +00:00
Henry Mercer
39d8d7e78f Merge pull request #1525 from github/update-v2.2.2-927de483f
Merge main into releases/v2
2023-02-06 19:46:06 +00:00
Angela P Wen
39c954c513 Support security-experimental as a well-known suite (#1519) 2023-02-06 19:26:03 +00:00
github-actions[bot]
8af83634ca Update changelog for v2.2.2 2023-02-06 19:16:08 +00:00
Henry Mercer
927de483f0 Merge pull request #1523 from github/henrymercer/fix/cli-version-for-different-bundles
Fix toolcache behavior when downloading bundle from another repo
2023-02-06 19:05:45 +00:00
Henry Mercer
e4c0a1b24d Merge branch 'main' into henrymercer/fix/cli-version-for-different-bundles 2023-02-06 18:24:11 +00:00
Henry Mercer
d3962273b3 Merge pull request #1517 from github/henrymercer/fix/not-all-bundle-urls-contain-tag
Fix assumption that all CodeQL bundle URLs contain the tag name of the bundle
2023-02-06 18:20:21 +00:00
Henry Mercer
c3cb270725 Merge pull request #1521 from MahmoudMabrok/patch-1
docs: add direct link to website
2023-02-06 16:34:01 +00:00
Henry Mercer
2b674f7ab9 Fix toolcache behavior when downloading bundle from another repo 2023-02-06 16:25:07 +00:00
Henry Mercer
6d47a7c8b1 Add regression test for bundle from different repo 2023-02-06 16:25:07 +00:00
Henry Mercer
c6ff11c1c4 Add changelog note 2023-02-06 16:24:25 +00:00
Henry Mercer
d3f2b2e6d2 Warn when multiple bundles for a single CLI are found in the toolcache 2023-02-06 12:28:33 +00:00
Henry Mercer
d49282c3b5 Rename forceLatest to forceShippedTools 2023-02-06 11:57:48 +00:00
Mahmoud Mabrok Fouad
c5c475188a docs: add direct link to website
To make it easy for users to go to website for more info.
2023-02-05 13:56:35 +02:00
Henry Mercer
f140af5e28 Refactor setting up CodeQL to handle bundle URLs without tags 2023-02-03 19:15:06 +00:00
Henry Mercer
e0fc1c91b2 Add regression test for a bundle URL without a tag 2023-02-03 19:13:24 +00:00
Arthur Baars
b95df0b2e7 Merge pull request #1516 from aibaars/auth-parameter
Supply authorization parameter to toolcache.downloadTool()
2023-02-03 20:02:59 +01:00
Arthur Baars
2fed02cbe2 Supply authorization parameter to toolcache.downloadTool()
Previously we supplied the authorization information via the 'headers'
parameter. This works fine, except in some cases when the request is
retried.
2023-02-03 14:56:00 +01:00
Angela P Wen
0b2a40fa4a Merge pull request #1515 from github/mergeback/v2.2.1-to-main-3ebbd71c
Mergeback v2.2.1 refs/heads/releases/v2 into main
2023-01-27 02:02:26 -08:00
github-actions[bot]
395ec04a8b Update checked-in dependencies 2023-01-27 09:37:04 +00:00
github-actions[bot]
e1070bd101 Update changelog and version after v2.2.1 2023-01-27 09:30:07 +00:00
Angela P Wen
3ebbd71c74 Merge pull request #1514 from github/update-v2.2.1-4664f3969
Merge main into releases/v2
2023-01-27 01:28:20 -08:00
github-actions[bot]
2ae6e13cc3 Update changelog for v2.2.1 2023-01-27 09:06:39 +00:00
Angela P Wen
4664f39699 Ensure that tools_download_duration_ms is int (#1513) 2023-01-27 09:03:57 +00:00
Henry Mercer
b2e16761f3 Merge pull request #1512 from github/mergeback/v2.2.0-to-main-436dbd91
Mergeback v2.2.0 refs/heads/releases/v2 into main
2023-01-26 17:44:11 +00:00
github-actions[bot]
592a896a53 Update checked-in dependencies 2023-01-26 16:40:56 +00:00
github-actions[bot]
4a6b5a54c2 Update changelog and version after v2.2.0 2023-01-26 16:39:29 +00:00
Henry Mercer
436dbd9100 Merge pull request #1511 from github/update-v2.2.0-43f1a6c70
Merge main into releases/v2
2023-01-26 16:37:04 +00:00
Henry Mercer
d966969093 Remove $ from version number 2023-01-26 15:22:33 +00:00
github-actions[bot]
f6d03f448d Update changelog for v2.2.0 2023-01-26 15:18:19 +00:00
Henry Mercer
43f1a6c701 Merge pull request #1510 from github/henrymercer/fix-fallback-version-number
Fix computation of fallback version number
2023-01-26 14:17:40 +00:00
Henry Mercer
75ae065ae6 Fix computation of fallback version 2023-01-26 11:49:51 +00:00
Henry Mercer
0a9e9db27f Add failing regression test 2023-01-26 11:49:24 +00:00
Angela P Wen
24ca6b0400 Send tools telemetry to init status report (#1497)
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2023-01-25 11:09:18 -08:00
Andrew Eisenberg
ebf6415a7d Merge pull request #1493 from github/aeisenberg/upload-sarif-limits
Update CHANGELOG.md with new limits on uploading SARIF
2023-01-25 08:32:05 -08:00
Henry Mercer
a58e90a9da Merge pull request #1508 from github/henrymercer/default-version-fallback
Fall back to the `defaults.json` CLI version if feature flags misconfigured
2023-01-24 20:01:47 +00:00
Andrew Eisenberg
fdff4b0a17 Update CHANGELOG.md
Remove apiVersion parameter.
2023-01-24 08:25:23 -08:00
Andrew Eisenberg
8840544b91 Merge branch 'main' into aeisenberg/upload-sarif-limits 2023-01-24 08:23:50 -08:00
Henry Mercer
af42a70c34 Merge pull request #1504 from github/dependabot/npm_and_yarn/octokit/types-9.0.0
Bump @octokit/types from 8.0.0 to 9.0.0
2023-01-24 12:28:00 +00:00
Henry Mercer
824a20f6aa Merge pull request #1507 from github/henrymercer/swift-autobuild-timeout
Limit Swift autobuild runtime in PR check to 10 minutes
2023-01-23 20:16:40 +00:00
Henry Mercer
fa47d5ade1 Merge pull request #1505 from github/henrymercer/more-node-12-cleanup
More cleanup as a result of dropping Node 12
2023-01-23 20:11:32 +00:00
github-actions[bot]
71109eca74 Update checked-in dependencies 2023-01-23 20:03:33 +00:00
Henry Mercer
5d931ea2a2 Fall back to the default.json CLI version if feature flags misconfigured 2023-01-23 20:00:44 +00:00
dependabot[bot]
6b17e95b97 Bump @octokit/types from 8.0.0 to 9.0.0
Bumps [@octokit/types](https://github.com/octokit/types.ts) from 8.0.0 to 9.0.0.
- [Release notes](https://github.com/octokit/types.ts/releases)
- [Commits](https://github.com/octokit/types.ts/compare/v8.0.0...v9.0.0)

---
updated-dependencies:
- dependency-name: "@octokit/types"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-23 19:48:29 +00:00
Henry Mercer
14c4412c63 Merge pull request #1506 from github/henrymercer/prepare-test-fail-early
Fail `prepare-test` early when `gh release list` fails
2023-01-23 19:39:31 +00:00
Henry Mercer
ebdd5a069f Remove perf_hooks Node 12 comment
We don't need the import for Node 12 compat, but we do need it to make
the file compile.
2023-01-23 19:16:03 +00:00
Henry Mercer
5da183dcc2 Bump npm to v9.2.0
npm v9.3.0 is out, but seems to have a bug with `npm ci` on macOS
where it will complain that `node_modules/.bin` is a directory.

We specify an exact version for reproducibility of builds.
2023-01-23 19:15:21 +00:00
Henry Mercer
b873a18a2f Limit Swift autobuild runtime to 10 minutes
There's a known issue that causes the Swift autobuilder to hang.  By
setting a timeout, we'll fail earlier and we can rerun the check
earlier.
2023-01-23 19:12:27 +00:00
Henry Mercer
66ed6f46ba Merge pull request #1503 from github/dependabot/npm_and_yarn/octokit/plugin-retry-4.0.4
Bump @octokit/plugin-retry from 3.0.9 to 4.0.4
2023-01-23 18:53:46 +00:00
Henry Mercer
90bbfad4eb Fail prepare-test early when gh release list fails 2023-01-23 18:50:59 +00:00
Henry Mercer
05d21eda44 Merge pull request #1501 from github/henrymercer/codeql-cli-2.12.1
Bump default CodeQL version to 2.12.1
2023-01-23 18:02:27 +00:00
github-actions[bot]
45eb0a66d5 Update checked-in dependencies 2023-01-23 17:26:40 +00:00
dependabot[bot]
78f2db88fc Bump @octokit/plugin-retry from 3.0.9 to 4.0.4
Bumps [@octokit/plugin-retry](https://github.com/octokit/plugin-retry.js) from 3.0.9 to 4.0.4.
- [Release notes](https://github.com/octokit/plugin-retry.js/releases)
- [Commits](https://github.com/octokit/plugin-retry.js/compare/v3.0.9...v4.0.4)

---
updated-dependencies:
- dependency-name: "@octokit/plugin-retry"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-23 17:02:48 +00:00
Andrew Eisenberg
604a6c3f8e Merge branch 'main' into aeisenberg/upload-sarif-limits 2023-01-23 08:35:54 -08:00
Andrew Eisenberg
fe9baed306 Fix typo in CHANGELOG.md
Co-authored-by: Jenny Rukman <jennyrocku@github.com>
2023-01-23 08:35:27 -08:00
Henry Mercer
f9ae0b9ced Merge branch 'main' into henrymercer/codeql-cli-2.12.1 2023-01-23 13:27:47 +00:00
Henry Mercer
5794d966f2 Merge pull request #1502 from github/henrymercer/python-packages-use-path-from-action
Use CodeQL path from `init` Action in Windows Python dependencies PR checks
2023-01-23 13:26:24 +00:00
Henry Mercer
64580b3179 Update workflow name to reflect Windows tests 2023-01-23 13:01:27 +00:00
Henry Mercer
e05bd5a671 Use CodeQL path from init Action in Windows Python deps PR checks 2023-01-23 13:01:11 +00:00
Henry Mercer
d37dce28f6 Bump default CodeQL version to 2.12.1 2023-01-23 11:25:09 +00:00
Henry Mercer
421a1b344f Merge pull request #1496 from github/henrymercer/no-cache-nightlies
Increase strictness of tool caching threshold to avoid caching nightlies
2023-01-20 17:57:55 +00:00
Andrew Eisenberg
42fb057842 Update CHANGELOG.md 2023-01-20 09:41:08 -08:00
Henry Mercer
54f4ea7a62 Merge branch 'main' into henrymercer/no-cache-nightlies 2023-01-20 17:35:04 +00:00
Henry Mercer
6456115682 Merge pull request #1494 from github/henrymercer/avoid-waiting-for-timeout
Fix a bug that forced the `init` Action to run for at least two minutes on JavaScript
2023-01-20 17:24:48 +00:00
Henry Mercer
8e4a1d6e60 Merge branch 'main' into henrymercer/avoid-waiting-for-timeout 2023-01-20 16:29:49 +00:00
Andrew Eisenberg
4dc41e1d1e Update CHANGELOG.md 2023-01-20 08:28:46 -08:00
Henry Mercer
4827181940 Merge pull request #1492 from github/henrymercer/upgrade-typescript
Upgrade to TypeScript 9.2.0
2023-01-20 16:28:14 +00:00
Henry Mercer
291cc75959 Add test case 2023-01-20 15:30:57 +00:00
Henry Mercer
2014c859f1 Increase strictness of tool caching threshold to avoid caching nightlies 2023-01-20 15:23:27 +00:00
Henry Mercer
4beb39593b Explain why we're using --format=json to get the extractor path 2023-01-20 15:01:38 +00:00
Henry Mercer
be8f7b01a2 Add types for package.json via @schemastore/package 2023-01-20 15:01:35 +00:00
Henry Mercer
1b508953b4 Remove checkActionVersion
This is no longer needed now that we only release v2
2023-01-20 15:01:35 +00:00
Henry Mercer
cb9be70046 Install @types/uuid and eliminate a cast 2023-01-20 15:01:35 +00:00
Henry Mercer
85f0d840c9 Use a more Promise-oriented approach for the timeout system 2023-01-19 20:25:55 +00:00
Henry Mercer
ffb06d7053 Add changelog note 2023-01-19 20:03:37 +00:00
Henry Mercer
b61b299591 Immediately unref timers to avoid waiting for them before exit 2023-01-19 18:09:06 +00:00
Andrew Eisenberg
68a248623f Update CHANGELOG.md with new limits on uploading SARIF 2023-01-19 09:57:22 -08:00
Henry Mercer
ba93815e25 Merge branch 'main' into henrymercer/upgrade-typescript 2023-01-19 16:15:51 +00:00
Henry Mercer
60e5868d6e Merge pull request #1475 from github/henrymercer/controlled-switchover
Enable a controlled switchover between CodeQL releases
2023-01-19 09:42:22 +00:00
Henry Mercer
9012214c80 Merge branch 'main' into henrymercer/controlled-switchover 2023-01-18 22:38:54 +00:00
Henry Mercer
4306b97e96 Add a .DS_Store file shipped with a dependency
We should be checking in all contents of the dependencies, including OS
junk!
2023-01-18 21:10:30 +00:00
Henry Mercer
d5dcff5766 Remove Node 12 compatibility check 2023-01-18 21:07:41 +00:00
Henry Mercer
0a11e3fdd9 Bump packages to fix linter 2023-01-18 21:00:07 +00:00
Henry Mercer
ed9506bbaf Bump eslint-plugin-import to avoid vulnerability in dependency 2023-01-18 21:00:05 +00:00
Henry Mercer
10695e6a20 Fix linter errors 2023-01-18 21:00:05 +00:00
Henry Mercer
5f644f971e Upgrade TypeScript to 9.2.0 2023-01-18 20:59:57 +00:00
Henry Mercer
40a75182e7 Merge pull request #1483 from github/henrymercer/remove-v1-checks
Remove PR checks for v1
2023-01-18 19:27:56 +00:00
Henry Mercer
48ae29987c Merge pull request #1482 from github/henrymercer/remove-v1-from-release-process
Remove v1 from the release process
2023-01-18 19:26:38 +00:00
Henry Mercer
16d8967389 Merge pull request #1490 from github/mergeback/v2.1.39-to-main-a34ca99b
Mergeback v2.1.39 refs/heads/releases/v2 into main
2023-01-18 19:26:15 +00:00
github-actions[bot]
6d37d7534f Update checked-in dependencies 2023-01-18 18:27:52 +00:00
github-actions[bot]
bb36dc476d Update changelog and version after v2.1.39 2023-01-18 18:16:09 +00:00
Henry Mercer
a34ca99b46 Merge pull request #1489 from github/update-v2.1.39-597c2041
Merge main into releases/v2
2023-01-18 18:14:06 +00:00
github-actions[bot]
48fa82899a Update changelog for v2.1.39 2023-01-18 17:27:01 +00:00
Henry Mercer
597c204127 Merge pull request #1481 from github/henrymercer/discontinue-v1
Update deprecation notice to state that CodeQL Action v1 is discontinued
2023-01-18 17:24:19 +00:00
Henry Mercer
3d62f02555 Update changelog note 2023-01-18 15:59:07 +00:00
Henry Mercer
8a4abfd10a Support cli-version-x.y.z-pre.txt marker files 2023-01-18 15:55:23 +00:00
Henry Mercer
5f1362dd53 Merge branch 'main' into henrymercer/controlled-switchover 2023-01-18 15:37:28 +00:00
Andrew Eisenberg
e0fd640b0c Merge pull request #1487 from github/aeisenberg/queries-check
Fix a bug in cli config parsing
2023-01-18 07:29:34 -08:00
Henry Mercer
d731c012c4 Merge pull request #1486 from github/update-supported-enterprise-server-versions
Update supported GitHub Enterprise Server versions.
2023-01-18 12:57:55 +00:00
Henry Mercer
6dfc772b5f Add link to new changelog post 2023-01-18 12:42:11 +00:00
Henry Mercer
60e58b4a21 Merge branch 'main' into henrymercer/discontinue-v1 2023-01-18 12:19:49 +00:00
Andrew Eisenberg
9b1206e898 Fix a bug in cli config parsing
When the config specifies queries in external repositories and no other
queries and cli config parsing is enabled, the analyze job is not able
to find any queries to run and it fails. This PR fixes the problem.

Also add some logging statements when writing a copy of the user config
file.
2023-01-17 20:59:36 -08:00
Andrew Eisenberg
40cfcb0a3f Merge pull request #1485 from github/aeisenberg/comitoid-message
Hide error message and stack for non-error
2023-01-17 17:21:14 -08:00
GitHub
e199504667 Update supported GitHub Enterprise Server versions. 2023-01-18 00:12:15 +00:00
Andrew Eisenberg
e6e3bf4923 Update src/actions-util.ts
Co-authored-by: Angela P Wen <angelapwen@github.com>
2023-01-17 15:53:14 -08:00
Andrew Eisenberg
5b9b480165 Update changelog 2023-01-17 15:05:22 -08:00
Andrew Eisenberg
b625b628b7 Hide error message and stack for non-error
Avoid printing the error message and stack when we fail to find the
commit. This will happen in several non-error states (e.g.,
when there is no repository checked out at the CWD). Move the
error message to a debug message so that it is still available
if someone really wants to see it.
2023-01-17 15:00:24 -08:00
Henry Mercer
e530813ab8 Remove PR checks for v1 2023-01-16 18:49:32 +00:00
Henry Mercer
5fe1a9b8af Update mergeback workflow 2023-01-16 18:41:03 +00:00
Henry Mercer
ba674fb1af Update release workflow 2023-01-16 18:37:43 +00:00
Henry Mercer
e0b20eea50 Migrate release script to template strings 2023-01-16 18:15:29 +00:00
Henry Mercer
218d40db4c Remove v1 only parts of release script 2023-01-16 18:09:01 +00:00
Henry Mercer
28c93a0113 Add changelog note 2023-01-16 17:56:37 +00:00
Henry Mercer
4b40a3a20e Add a notice that CodeQL Action v1 is discontinued 2023-01-16 17:56:31 +00:00
Henry Mercer
a5b44c1a39 Add a sentence on recommended practices for using the CLI 2023-01-16 10:26:34 +00:00
Henry Mercer
b660a383cf Address review comments 2023-01-16 10:14:35 +00:00
Henry Mercer
115587a52c Merge branch 'main' into henrymercer/controlled-switchover 2023-01-16 10:10:15 +00:00
Henry Mercer
ac7e4d772e Improve changelog note some more 2023-01-16 09:53:43 +00:00
Rasmus Wriedt Larsen
32be38eeff Merge pull request #1431 from github/rasmuswl/poetry-always-install-pip
python-setup: Handle poetry `virtualenvs.options.no-pip = true`
2023-01-16 09:31:13 +01:00
Henry Mercer
eca06a5561 Further improve changelog notes 2023-01-13 18:03:03 +00:00
Henry Mercer
13cdac30cc Improve changelog notes 2023-01-13 16:24:38 +00:00
Henry Mercer
12998b7ba3 Convert logger call to debug 2023-01-13 16:18:46 +00:00
Rasmus Wriedt Larsen
5ed1e985c2 python-setup: Fix site-package selection for unix 2023-01-13 14:41:00 +01:00
Rasmus Wriedt Larsen
4bd9723e2b npm run build 2023-01-13 11:26:22 +01:00
Rasmus Wriedt Larsen
2f6d17472d python-setup: Make debug printing more obvious 2023-01-13 11:25:25 +01:00
Rasmus Wriedt Larsen
2649b6603a python-setup: Fix site-packages selection without pip for Windows 2023-01-13 11:25:25 +01:00
Rasmus Wriedt Larsen
b8107301d2 python-setup: Fix for python2 2023-01-13 11:25:25 +01:00
Rasmus Wriedt Larsen
ebf1b8f8fc Fix prettier problem 2023-01-13 11:25:25 +01:00
Rasmus Wriedt Larsen
932b6a98b8 python-setup: Fix path for tests 2023-01-13 11:25:25 +01:00
Rasmus Wriedt Larsen
259993b92a python-setup: Handle poetry virtualenvs.options.no-pip = true
Fixes https://github.com/github/codeql-action/issues/1425
2023-01-13 11:25:25 +01:00
Henry Mercer
0be20e5ce1 Use the CLI version when caching the bundle in telemetry too 2023-01-12 21:09:09 +00:00
Henry Mercer
33206d299e Include the bundle version in the toolcache version number
This gives us an easy cache hit when requesting the same tools URL.
2023-01-12 20:56:31 +00:00
Henry Mercer
c2e39e078f Cache explicitly requested bundles with their URL if possible 2023-01-12 20:44:05 +00:00
Henry Mercer
c9b1be5115 Bump version to 2.2.0 2023-01-12 16:07:23 +00:00
Henry Mercer
28f827aefa Add changelog notes 2023-01-12 16:06:08 +00:00
Henry Mercer
9578699f19 Merge branch 'main' into henrymercer/controlled-switchover 2023-01-12 15:55:36 +00:00
Henry Mercer
31c7ce1ce4 Add doc describing CLI version marker files 2023-01-12 15:51:12 +00:00
Henry Mercer
a89ad76881 Expand note about defaults.json compatibility
In the future we might convert the file to JSON with comments, or add
this note to a JSON schema.
2023-01-12 15:46:12 +00:00
Henry Mercer
1eeb9df353 Remove dead code 2023-01-12 15:41:17 +00:00
Henry Mercer
648838c4a0 Allow using a x.y.z-yyyymmdd toolcache version for CLI x.y.z. 2023-01-12 15:41:07 +00:00
Henry Mercer
2073a69919 Merge pull request #1477 from github/mergeback/v2.1.38-to-main-515828d9
Mergeback v2.1.38 refs/heads/releases/v2 into main
2023-01-12 11:25:42 +00:00
github-actions[bot]
10f2d3c15a Update checked-in dependencies 2023-01-12 10:42:07 +00:00
github-actions[bot]
00c2a84eba Update changelog and version after v2.1.38 2023-01-12 10:35:11 +00:00
Henry Mercer
515828d974 Merge pull request #1476 from github/update-v2.1.38-70fdddff
Merge main into releases/v2
2023-01-12 10:32:43 +00:00
github-actions[bot]
caa49ae471 Update changelog for v2.1.38 2023-01-12 02:27:49 +00:00
Henry Mercer
e8c12e1f7d Add a debug log for the feature flag API response 2023-01-11 19:10:22 +00:00
Henry Mercer
2f7b9a1280 Differentiate setupCodeql.setupCodeQL from codeql.setupCodeQL 2023-01-11 19:06:50 +00:00
Henry Mercer
23d151db1c Add test for using default version with no requested URL on Dotcom 2023-01-11 19:06:50 +00:00
Henry Mercer
c3be36f5cb Use new default version to set up CodeQL 2023-01-11 19:06:50 +00:00
Henry Mercer
bd2f52fcef Move CodeQL setup to its own file 2023-01-11 19:06:50 +00:00
Henry Mercer
a76fe4f9bd Enable mapping from CLI version to bundle tag name 2023-01-11 19:06:50 +00:00
Henry Mercer
a6dff04fe1 Ignore default version flags with invalid version numbers 2023-01-11 19:06:49 +00:00
Henry Mercer
cdb90196f2 Support determining Dotcom CLI version from feature flags 2023-01-11 18:40:47 +00:00
Henry Mercer
70fdddff11 Merge pull request #1474 from github/henrymercer/fix-ghae-setup-test
Refactor CodeQL setup tests and fix GHAE test
2023-01-11 17:14:35 +00:00
Henry Mercer
6ba0a36550 Add JSDoc for mockDownloadApi 2023-01-11 15:25:21 +00:00
Henry Mercer
4a918790cd Merge branch 'main' into henrymercer/fix-ghae-setup-test 2023-01-11 15:23:04 +00:00
Andrew Eisenberg
42d6d35dd1 Merge pull request #1464 from github/aeisenberg/externalRepoTokenConfigParsing
Send the external repository token to the CLI
2023-01-10 14:03:12 -08:00
Andrew Eisenberg
e009918fbc Merge branch 'main' into aeisenberg/externalRepoTokenConfigParsing 2023-01-10 12:43:37 -08:00
Henry Mercer
70a288daae Merge branch 'main' into henrymercer/fix-ghae-setup-test 2023-01-10 20:37:40 +00:00
Dave Bartolomeo
bdc7c5d203 Merge pull request #1466 from github/dbartol/bundle-20230105
Update bundle to 2.12.0
2023-01-10 15:37:19 -05:00
Andrew Eisenberg
272d916f23 Address comments from PR 2023-01-10 12:17:26 -08:00
Henry Mercer
f12f76f047 Merge pull request #1473 from github/henrymercer/temporarily-disable-kotlin-in-pr-checks
Temporarily disable Kotlin analysis in PR checks
2023-01-10 19:49:21 +00:00
Henry Mercer
28a9b2d6d7 Add a note regarding the sinon workaround 2023-01-10 19:43:23 +00:00
Henry Mercer
9f8ddbdfd7 Fix GHAE CodeQL setup test 2023-01-10 19:36:29 +00:00
Henry Mercer
9203e314a3 Improve CodeQL setup test structure and naming 2023-01-10 19:35:21 +00:00
Henry Mercer
80b12d6f73 Ensure we don't unset CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN 2023-01-10 17:42:24 +00:00
Henry Mercer
620a267204 Temporarily disable Kotlin analysis in PR checks
Kotlin analysis is incompatible with Kotlin 1.8.0, which is now rolling
out to the Actions runner images.

While we work on a more permanent fix to our PR checks, this will
prevent us losing other
test coverage.
2023-01-10 17:31:35 +00:00
Dave Bartolomeo
bac4fe1a38 Merge branch 'main' into dbartol/bundle-20230105 2023-01-10 09:31:07 -05:00
Robert
166d98c19e Merge pull request #1465 from github/robertbrignull/upload_database_stream
Use a stream when uploading database contents
2023-01-09 12:37:54 +00:00
Robert
a9337bc304 Close stream after use 2023-01-09 11:00:43 +00:00
Andrew Eisenberg
4023575d64 Send the external repository token to the CLI
This commit does a few related things:

1. Bumps the minimum version for cli config parsing to 2.10.6
2. Ensures that if cli config parsing is enabled, then remove repos
   are _not_ downloaded by the action. It happens in the CLI.
3. Passes the `--external-repository-token-stdin` option to the CLI
   and passes the appropriate token via stdin if cli config parsing is
   enabled.
2023-01-06 14:46:28 -08:00
Henry Mercer
cf1437a514 Merge pull request #1462 from github/henrymercer/refactor-codeql-setup
Refactor CodeQL setup
2023-01-06 17:36:02 +00:00
Dave Bartolomeo
f9c9a2567c Rebuild 2023-01-06 12:32:23 -05:00
Dave Bartolomeo
b9c859bfa1 Merge branch 'main' into dbartol/bundle-20230105 2023-01-06 11:56:06 -05:00
Angela P Wen
b4187d626b Add CLI version field and prior release fields to defaults file (#1463)
* Add CLI version field to `defaults` file

* Add fields for prior CLI version
2023-01-06 08:24:28 -08:00
Dave Bartolomeo
bfbb7ab03c Add change note for bundle update 2023-01-06 11:00:35 -05:00
Dave Bartolomeo
4e5a06f009 Update to CoideQL bundle 20230105 (2.12.0) 2023-01-06 10:55:46 -05:00
Robert
e8f7169839 Move database bundling to inside the try-catch 2023-01-06 15:28:25 +00:00
Robert
6ce923c375 Use a stream when uploading database contents 2023-01-06 15:16:51 +00:00
Henry Mercer
b2b478264a Improve logging around authorization headers 2023-01-06 12:28:54 +00:00
Henry Mercer
5eba74a3c9 Refactor CodeQL setup 2023-01-05 19:09:34 +00:00
Henry Mercer
ff3337ee1b Merge pull request #1444 from github/henrymercer/reporting-failed-run-improvements
Improve reporting failed runs via SARIF
2023-01-04 10:43:15 +00:00
Aditya Sharad
484236cda4 Merge pull request #1460 from github/adityasharad/actions/code-scanning-schedule
Code scanning: Add scheduled trigger to workflow
2023-01-03 14:29:44 -08:00
Aditya Sharad
f837e8e761 Code scanning: Add step titles to workflow 2023-01-03 13:00:12 -08:00
Aditya Sharad
ef21864950 Code scanning: Add scheduled trigger to workflow
Ensure we are regularly running code scanning using
the latest CodeQL and remain up to date with the
internal security scorecard, even if we have a period
longer than a week with no pushes to the repo.
2023-01-03 12:59:13 -08:00
Henry Mercer
4789c1331c Add more tests for uploading failed SARIF
Test results directly via return value of `testFailedSarifUpload` vs
via checking log messages.
2022-12-22 18:48:59 +00:00
Henry Mercer
59ebabde5d Remove redundant log messages 2022-12-22 18:47:52 +00:00
Henry Mercer
3224214d91 Improve method naming 2022-12-22 18:33:06 +00:00
Henry Mercer
e09fbf5b4a Demote upload failed SARIF run info statements to debug
We now report errors via telemetry, and this feature will shortly be
enabled by default.
2022-12-21 11:41:36 +00:00
Henry Mercer
e9ff99b027 Improve error message when workflow file doesn't exist 2022-12-21 11:40:31 +00:00
Henry Mercer
8b9e982393 Add a better log message for reusable workflow calls 2022-12-21 11:40:31 +00:00
Henry Mercer
8d1e008ecb Check for successful completion rather than SARIF upload
This doesn’t affect the overall behaviour, but means we can
short-circuit slightly more quickly when `analyze` is passed
`upload: false`.
2022-12-21 11:40:31 +00:00
Henry Mercer
579411fb6c Merge pull request #1441 from github/henrymercer/remove-old-certifi-tests
Remove tests with old certifi dependency
2022-12-20 18:43:19 +00:00
Henry Mercer
e4818d46c4 Remove tests with old certifi dependency 2022-12-20 10:30:38 +00:00
Angela P Wen
4778dfbd93 Set up the Swift version the extractor declares (#1422)
Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
2022-12-19 13:08:15 -08:00
Henry Mercer
0a3f985290 Merge pull request #1437 from github/mergeback/v2.1.37-to-main-959cbb74
Mergeback v2.1.37 refs/heads/releases/v2 into main
2022-12-14 14:56:05 +00:00
github-actions[bot]
04f1897968 Update checked-in dependencies 2022-12-14 14:10:28 +00:00
github-actions[bot]
6ac6037211 Update changelog and version after v2.1.37 2022-12-14 14:06:24 +00:00
Henry Mercer
959cbb7472 Merge pull request #1436 from github/update-v2.1.37-d58039a1
Merge main into releases/v2
2022-12-14 14:04:14 +00:00
github-actions[bot]
10ca836463 Update changelog for v2.1.37 2022-12-14 11:07:27 +00:00
Orhan Toy
d58039a1e3 Merge pull request #1435 from github/orhantoy/add-CODE_SCANNING_REF-tests
Add tests for CODE_SCANNING_REF
2022-12-13 23:10:53 +01:00
Henry Mercer
37a4496237 Merge pull request #1433 from github/henrymercer/use-codeql-2.11.6
Bump default CodeQL version to 2.11.6
2022-12-13 13:05:00 +00:00
Orhan Toy
b7028afcb4 Make sure env is reset between tests 2022-12-13 12:18:40 +00:00
Henry Mercer
f629dada4c Merge branch 'main' into henrymercer/use-codeql-2.11.6 2022-12-13 12:15:58 +00:00
Orhan Toy
ccee4c68ff Add tests for CODE_SCANNING_REF 2022-12-13 11:51:16 +00:00
Henry Mercer
899bf9c076 Merge pull request #1432 from github/henrymercer/init-post-telemetry
Add telemetry for uploading failed runs
2022-12-12 18:45:41 +00:00
Henry Mercer
dd7c3ef80e Remove debugging log statements 2022-12-12 17:59:20 +00:00
Henry Mercer
b7b875efff Reuse existing fields in post-init status report 2022-12-12 17:54:33 +00:00
Nick Fyson
53ab991fbe Merge pull request #1434 from github/nickfyson/remove-query-string
remove use of query-string package
2022-12-12 16:40:33 +00:00
nickfyson
54d25f56dd use .has for searchParams instead of checking for undefined 2022-12-12 16:03:07 +00:00
nickfyson
d827cf3d65 remove use of query-string package 2022-12-12 14:50:10 +00:00
Henry Mercer
9438015b82 Add changelog note 2022-12-12 13:11:03 +00:00
Henry Mercer
5aced81848 Update bundle version to codeql-bundle-20221211 2022-12-12 13:10:58 +00:00
Henry Mercer
118e294bb9 Record the stack trace if applicable 2022-12-09 10:35:28 +00:00
Henry Mercer
dc9c1c1a51 Add regression test for upload: false 2022-12-09 10:35:28 +00:00
Henry Mercer
a409f43c7a Handle non-string with inputs 2022-12-09 10:35:28 +00:00
Henry Mercer
e67ad6aaed Add telemetry for uploading failed runs 2022-12-09 10:35:19 +00:00
Chuan-kai Lin
896079047b Merge pull request #1429 from github/mergeback/v2.1.36-to-main-a669cc59
Mergeback v2.1.36 refs/heads/releases/v2 into main
2022-12-08 12:35:17 -08:00
github-actions[bot]
e58b8d6a61 Update checked-in dependencies 2022-12-08 20:03:08 +00:00
github-actions[bot]
01330498de Update changelog and version after v2.1.36 2022-12-08 20:00:59 +00:00
Chuan-kai Lin
a669cc5936 Merge pull request #1428 from github/update-v2.1.36-2b971a70
Merge main into releases/v2
2022-12-08 11:58:43 -08:00
Andrew Eisenberg
6fec2ab57a Merge pull request #1427 from github/dependabot/pip/python-setup/tests/poetry/python-3.8/certifi-2022.12.7
Bump certifi from 2021.10.8 to 2022.12.7 in /python-setup/tests/poetry/python-3.8
2022-12-08 11:24:01 -08:00
github-actions[bot]
aab7a26877 Update changelog for v2.1.36 2022-12-08 19:22:44 +00:00
Henry Mercer
2b971a70bb Merge pull request #1426 from github/dependabot/pip/python-setup/tests/poetry/requests-3/certifi-2022.12.7
Bump certifi from 2021.10.8 to 2022.12.7 in /python-setup/tests/poetry/requests-3
2022-12-08 18:16:20 +00:00
dependabot[bot]
4e81e2933a Bump certifi in /python-setup/tests/poetry/python-3.8
Bumps [certifi](https://github.com/certifi/python-certifi) from 2021.10.8 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2021.10.08...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 17:36:48 +00:00
dependabot[bot]
bf944d782b Bump certifi in /python-setup/tests/poetry/requests-3
Bumps [certifi](https://github.com/certifi/python-certifi) from 2021.10.8 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2021.10.08...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 17:36:47 +00:00
Andrew Eisenberg
566a5e6727 Merge pull request #1424 from github/dependabot/pip/python-setup/tests/pipenv/python-3.8/certifi-2022.12.7
Bump certifi from 2021.10.8 to 2022.12.7 in /python-setup/tests/pipenv/python-3.8
2022-12-08 09:35:45 -08:00
Chuan-kai Lin
10c89976dc Merge pull request #1421 from github/cklin/fix-update-required-checks-sha
update-required-checks.sh: fix argument handling
2022-12-08 09:05:57 -08:00
dependabot[bot]
8121f62c54 Bump certifi in /python-setup/tests/pipenv/python-3.8
Bumps [certifi](https://github.com/certifi/python-certifi) from 2021.10.8 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2021.10.08...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 16:26:53 +00:00
Andrew Eisenberg
104319fe98 Merge pull request #1423 from github/dependabot/pip/python-setup/tests/pipenv/requests-3/certifi-2022.12.7
Bump certifi from 2021.10.8 to 2022.12.7 in /python-setup/tests/pipenv/requests-3
2022-12-08 08:25:36 -08:00
dependabot[bot]
aba18b82f7 Bump certifi in /python-setup/tests/pipenv/requests-3
Bumps [certifi](https://github.com/certifi/python-certifi) from 2021.10.8 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2021.10.08...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 12:47:50 +00:00
Chuan-kai Lin
4a5ad5af18 update-required-checks.sh: ignore check-expected-release-files 2022-12-07 14:27:32 -08:00
Chuan-kai Lin
19f867a052 Merge branch 'main' into cklin/fix-update-required-checks-sha 2022-12-07 10:37:25 -08:00
Chuan-kai Lin
5e452f0d9d Merge pull request #1412 from github/cklin/codeql-cli-2.11.5
Bump default CodeQL version to 2.11.5
2022-12-07 10:36:40 -08:00
Chuan-kai Lin
8bebf77dbd update-required-checks.sh: fix argument handling 2022-12-07 10:12:01 -08:00
Chuan-kai Lin
fb74504ab5 Disable nightly-latest checks for Swift 2022-12-07 17:59:30 +00:00
Chuan-kai Lin
c51babb6c6 Merge branch 'main' into cklin/codeql-cli-2.11.5 2022-12-07 08:33:58 -08:00
Henry Mercer
79166d0788 Merge pull request #1420 from github/henrymercer/failed-runs-fix-action-not-found
Fix failed SARIF upload behavior when the workflow doesn't call the CodeQL Action
2022-12-07 08:48:11 +00:00
Rasmus Wriedt Larsen
44ef9d902a Merge pull request #1419 from github/rasmuswl/poetry-no-local-venv
python-setup: Don't allow Poetry to make venv in project
2022-12-06 20:29:23 +01:00
Henry Mercer
384a214d60 Allow testing workflow parsing functionality from PR checks 2022-12-06 18:37:25 +00:00
Henry Mercer
697ed97fa5 Factor out some code in post-init tests 2022-12-06 18:23:55 +00:00
Henry Mercer
2207a72006 Downgrade log severity when we can't upload a failed SARIF file
This isn't severe enough to appear on the Actions summary.
2022-12-06 18:18:07 +00:00
Henry Mercer
4623c8edb6 Make getInputOrThrow throw when it can't find any calls to the Action
This created unexpected behavior with a workflow calling
`codeql-action/analyze` locally.
Therefore, be more conservative with parsing inputs from workflows and
refuse to parse jobs that don't call the specified Action exactly once.
2022-12-06 18:13:47 +00:00
Henry Mercer
9085295c40 Add regression test 2022-12-06 17:59:14 +00:00
Rasmus Wriedt Larsen
3b0a2f607d python-setup: Update comment with fully qualified configuration name 2022-12-06 11:37:57 +01:00
Rasmus Wriedt Larsen
5566638d56 Update CHANGELOG.md 2022-12-06 11:37:31 +01:00
Rasmus Wriedt Larsen
27c1438455 python-setup: Apply suggestions from code review 2022-12-06 11:32:21 +01:00
Henry Mercer
1e8d3b8fca Merge pull request #1418 from github/henrymercer/remove-file-baseline-info-feature-flag
Enable file baseline export by default
2022-12-06 09:42:34 +00:00
Rasmus Wriedt Larsen
7fc528c3c6 python-setup: Don't allow Poetry to make venv in project
I mostly verified this works on my local machine, but did add a sample `poetry.toml` to the tests, so it can be verified from looking at the logs 🤷
2022-12-06 10:41:46 +01:00
Henry Mercer
2cbc140ac5 Enable file baseline export by default
This is now fully rolled out.
2022-12-05 14:10:06 +00:00
Henry Mercer
1653364141 Merge pull request #1414 from github/dependabot/github_actions/peter-evans/create-pull-request-4.2.3
Bump peter-evans/create-pull-request from 3.4.1 to 4.2.3
2022-12-05 11:02:42 +00:00
dependabot[bot]
61cc378b7f Bump swift-actions/setup-swift from 1.19.0 to 1.20.0 (#1415)
* Bump swift-actions/setup-swift from 1.19.0 to 1.20.0

Bumps [swift-actions/setup-swift](https://github.com/swift-actions/setup-swift) from 1.19.0 to 1.20.0.
- [Release notes](https://github.com/swift-actions/setup-swift/releases)
- [Commits](5cdaa9161a...194625b58a)

---
updated-dependencies:
- dependency-name: swift-actions/setup-swift
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update setup-swift SHA in non-autogenerated files

* Specify v5.7.0 instead of 5.7

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Angela P Wen <angelapwen@github.com>
2022-12-05 10:54:03 +01:00
dependabot[bot]
7aa5026a55 Bump actions/setup-python from 3 to 4 (#1416)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 08:20:36 +01:00
dependabot[bot]
c80f00a5c9 Bump peter-evans/create-pull-request from 3.4.1 to 4.2.3
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 3.4.1 to 4.2.3.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](c7f493a800...2b011faafd)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 19:29:01 +00:00
Henry Mercer
62b14cbbad Merge pull request #1413 from github/update-dependabot-e0f8a3c2
Add Dependabot config file
2022-12-02 19:28:32 +00:00
Henry Mercer
794a4b543a Switch to weekly interval for both ecosystems 2022-12-02 18:42:33 +00:00
Henry Mercer
ee6ba9c213 Reformat 2022-12-02 17:53:16 +00:00
Henry Mercer
81f99a8582 Remove outdated section for runner and perform all updates daily 2022-12-02 17:52:46 +00:00
Sentinel Reviewer
4b18b7bc24 Update Dependabot config file 2022-12-02 11:45:26 -06:00
Henry Mercer
4acf201e5b Merge pull request #1393 from github/henrymercer/report-failed-runs
Submit SARIF for failed runs too
2022-12-02 17:08:04 +00:00
Chuan-kai Lin
1e5919b22d Bump default CodeQL version to 2.11.5 2022-12-02 07:38:17 -08:00
Henry Mercer
375dacad24 Only print the full error message in debug mode 2022-12-02 14:38:40 +00:00
Henry Mercer
e0ff272230 Merge branch 'main' into henrymercer/report-failed-runs 2022-12-02 14:31:22 +00:00
Angela P Wen
aa0e650c6a Surface fatal CLI errors in interpret-results and run-queries (#1407)
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-12-02 14:05:21 +01:00
Henry Mercer
98b2ddc7f9 Merge branch 'main' into henrymercer/report-failed-runs 2022-12-01 18:27:32 +00:00
Henry Mercer
0d9b15ca93 Merge pull request #1392 from github/henrymercer/parse-category
Add functionality for parsing Action inputs from a workflow file
2022-12-01 18:26:03 +00:00
Henry Mercer
b1c26c4c53 Merge pull request #1409 from github/mergeback/v2.1.35-to-main-b2a92eb5
Mergeback v2.1.35 refs/heads/releases/v2 into main
2022-12-01 14:25:02 +00:00
github-actions[bot]
21044b004d Update checked-in dependencies 2022-12-01 13:51:17 +00:00
github-actions[bot]
0828b04e3a Update changelog and version after v2.1.35 2022-12-01 13:04:46 +00:00
Henry Mercer
b2a92eb56d Merge pull request #1406 from github/update-v2.1.35-9af9a11d
Merge main into releases/v2
2022-12-01 13:02:24 +00:00
github-actions[bot]
075b74d36e Update changelog for v2.1.35 2022-12-01 12:16:44 +00:00
Angela P Wen
9af9a11da8 Stop running fallback Go autobuild if database is finalized (#1405) 2022-12-01 11:29:03 +01:00
Andrew Eisenberg
a631f4b016 Merge pull request #1400 from github/aeisenberg/fix-test-error
Fixes spurious error messages in tests
2022-11-30 08:04:59 -08:00
Henry Mercer
77cda4d75d Add testing environment to submit SARIF after failure PR check 2022-11-30 11:32:36 +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
Andrew Eisenberg
1384ce4ab3 Fixes spurious error messages in tests
Previously, `isAnalyzingDefaultBranch` was failing because there are
some missing env vars: `GITHUB_SHA`, `GITHUB_REF`, and
`GITHUB_EVENT_PATH`. Also, `checkout_path` is missing as an input.

Rather than trying to set them to mock values, which would require
setting the paths to existing paths in the file system, I chose to stub
the entire function. I think this is fine since the point of the test
is to check the ram and threads values, not testing the
`isAnalyzingDefaultBranch` function.
2022-11-29 10:53:11 -08:00
Henry Mercer
6c5cad784c Merge branch 'henrymercer/parse-category' into henrymercer/report-failed-runs 2022-11-29 17:04:56 +00:00
Henry Mercer
58b2ab08a8 Add unit test for typical workflow 2022-11-29 17:03:01 +00:00
Henry Mercer
e0dec83cfc Explicitly mention surrounding by try/catch in JSDoc 2022-11-29 16:29:27 +00:00
Henry Mercer
00a3c456fb Always wait for processing when uploading a failed SARIF file 2022-11-29 16:27:04 +00:00
Henry Mercer
e628ee0ae1 Push unsuccessful execution API error detection into upload library 2022-11-29 16:25:29 +00:00
Henry Mercer
605b23d10b Explicitly suggest wrapping in a try/catch block 2022-11-29 15:48:54 +00:00
Rasmus Wriedt Larsen
160613c380 Merge pull request #1402 from github/rasmuswl/new-virtualenv
python-setup: rely on new `virtualenv` for venv creation in Ubuntu 22.04
2022-11-29 13:56:31 +01:00
Rasmus Wriedt Larsen
caf1c5057b python-setup: Remove outdated comment 2022-11-29 13:24:10 +01:00
Rasmus Wriedt Larsen
c62445de22 python-setup: rely on new virtualenv for venv creation in Ubuntu 22.04
Removes the hotfix from https://github.com/github/codeql-action/pull/1257
2022-11-29 11:43:01 +01:00
Henry Mercer
7fc3c603aa Add changelog note 2022-11-25 18:18:39 +00:00
Henry Mercer
24fd4c0f4e Generate the "Submit SARIF after failure" workflow 2022-11-25 18:18:13 +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
37b4358e44 Handle API versions that reject unsuccessful executions 2022-11-25 17:55:00 +00:00
Henry Mercer
122b180b66 Add an integration test for uploading SARIF when the run fails 2022-11-25 17:54:22 +00:00
Henry Mercer
8337c2be0f Only upload failed SARIF if the run failed 2022-11-25 17:53:32 +00:00
Henry Mercer
5296a763b1 Upload failed SARIF files to Code Scanning 2022-11-25 17:52:50 +00:00
Henry Mercer
3afc2b194c Add feature flag for uploading failed SARIF 2022-11-25 17:49:03 +00:00
Henry Mercer
3cf2a1ba2e Add function for retrieving the "upload" input 2022-11-25 17:49:01 +00:00
Henry Mercer
4d4e25083a Use a matrix in testing workflow 2022-11-25 17:47:21 +00:00
Henry Mercer
9de6c31571 Log matrix input 2022-11-25 17:47:21 +00:00
Henry Mercer
44ae944a29 Add a workflow to test reporting a failed run 2022-11-25 17:47:21 +00:00
Henry Mercer
e2338066a1 Add diagnostics export command 2022-11-25 17:47:21 +00:00
Henry Mercer
8f05fcd048 Filter set of possible Action inputs to those from a particular job
This better handles cases where customers have a monorepo and have
separate jobs for different components.
2022-11-25 17:40:27 +00:00
Alexander Eyers-Taylor
9dac9f748a Merge pull request #1396 from github/mergeback/v2.1.34-to-main-312e093a
Mergeback v2.1.34 refs/heads/releases/v2 into main
2022-11-25 16:14:10 +00:00
github-actions[bot]
c6e756bb39 Update checked-in dependencies 2022-11-25 15:38:27 +00:00
github-actions[bot]
8d8b898c0f Update changelog and version after v2.1.34 2022-11-25 15:20:20 +00:00
Alexander Eyers-Taylor
312e093a18 Merge pull request #1395 from github/update-v2.1.34-7e73deda
Merge main into releases/v2
2022-11-25 15:17:56 +00:00
github-actions[bot]
aef0440821 Update changelog for v2.1.34 2022-11-25 13:44:40 +00:00
Henry Mercer
9f2aa7ec75 Merge branch 'main' into henrymercer/parse-category 2022-11-25 09:58:27 +00:00
Henry Mercer
7e73dedacc Merge pull request #1394 from github/aeisenberg/bypass-toolcache-kotlin-swift
Add a way to bypass the toolcache for kotlin and swift
2022-11-25 09:30:35 +00:00
Andrew Eisenberg
102e01da36 Small refactoring of shouldBypassToolcache 2022-11-24 12:33:42 -08:00
Andrew Eisenberg
eb19ecbad1 Add API call for languages if java in input
If a user explicitly includes java in their language inputs, always
make an api call to check for kotlin in the repo.

Also, add some suggestions from code reviews.
2022-11-24 11:06:29 -08:00
Henry Mercer
f0a052e8b4 Merge pull request #1388 from github/henrymercer/bump-swift-version-to-5.7.1
Run Swift tests with Swift 5.7.1 on macOS
2022-11-24 15:37:32 +00:00
Henry Mercer
ead8da6199 Merge branch 'main' into henrymercer/bump-swift-version-to-5.7.1 2022-11-24 14:32:08 +00:00
Alexander Eyers-Taylor
c61f4c61f8 Merge pull request #1391 from github/alexet/update-2.11.4-v2
Update default CodeQL bundle version to 2.11.4
2022-11-24 14:23:06 +00:00
Andrew Eisenberg
ad7ca9bf21 Add some new tests and fix some comments 2022-11-23 22:18:12 -08:00
Andrew Eisenberg
f79028af27 Add the feature to bypass the toolcache for kotlin and swift
This works by moving the logic to check for toolcache bypass out of
creating the codeql instance. The logic now _may_ perform an API request
in order to check what languages are in the repository. This check is
redundant because the same call is being made later in the action when
the actual list of languages is calculated.
2022-11-23 15:11:20 -08:00
Henry Mercer
909c8687d5 Test Linux against Swift 5.7
Currently only macOS supports 5.7.1
2022-11-23 21:21:50 +00:00
Andrew Eisenberg
5b7c9daecd Add the bypass_toolcache_kotlin_switft_enabled flag 2022-11-23 12:20:22 -08:00
Henry Mercer
ce90479412 Test latest and nightly-latest against Swift 5.7.1 2022-11-23 20:17:20 +00:00
Henry Mercer
bff0be7364 Generalize getCategoryInputOrThrow to arbitrary inputs 2022-11-23 19:27:03 +00:00
Henry Mercer
daf4614f68 Substitute matrix variables into category input
This is a common case, so we should handle it.
2022-11-23 19:27:03 +00:00
Henry Mercer
e2d523ca5e Add function to read the analysis category from a workflow 2022-11-23 19:27:03 +00:00
Henry Mercer
996d04b1e5 Fix a type error affecting later versions of TypeScript 2022-11-23 19:27:03 +00:00
Henry Mercer
79f8286c68 Refactoring: Separate out workflow related functionality
No semantic changes.
2022-11-23 19:27:01 +00:00
Alexander Eyers-Taylor
d52e657b2e Update default CodeQL bundle version to 2.11.4 2022-11-23 18:56:23 +00:00
Henry Mercer
187515b328 Merge pull request #1390 from github/henrymercer/remove-dead-code
Remove some dead code
2022-11-23 18:55:09 +00:00
Henry Mercer
bc341c5dd1 Remove fallback logic for GHES 2.22 when determining Action repository 2022-11-23 18:19:25 +00:00
Henry Mercer
39fe7aa8a1 Remove dead guard for GHES 3.0 2022-11-23 13:57:07 +00:00
Henry Mercer
c719ec0b33 Merge pull request #1389 from github/update-supported-enterprise-server-versions
Update supported GitHub Enterprise Server versions.
2022-11-23 10:31:21 +00:00
Henry Mercer
09bfd560f6 Merge pull request #1385 from github/henrymercer/update-v1-deprecation-date
Update v1 deprecation date
2022-11-23 10:24:17 +00:00
Henry Mercer
33b2045510 Merge branch 'main' into henrymercer/update-v1-deprecation-date 2022-11-23 09:53:16 +00:00
GitHub
93c6b70dc3 Update supported GitHub Enterprise Server versions. 2022-11-23 00:13:03 +00:00
Henry Mercer
def4f60c6c Merge pull request #1387 from github/henrymercer/fix-swift-version
Use Swift version 5.7 in PR checks
2022-11-22 22:39:17 +00:00
Henry Mercer
34d91a9ce7 Use runner.os in ML-powered queries tests too 2022-11-22 20:45:26 +00:00
Henry Mercer
c49c05b5df Perform the check using runner.os 2022-11-22 20:41:32 +00:00
Henry Mercer
2ccaddd459 Define swift-version as a string 2022-11-22 20:33:22 +00:00
Henry Mercer
5dcca8a6e4 Pin the version of swift-actions/setup-swift@v1 2022-11-22 20:13:49 +00:00
Henry Mercer
b6e17a6616 Drop unneeded CODEQL_ENABLE_EXPERIMENTAL_FEATURES env var 2022-11-22 11:31:22 +00:00
Henry Mercer
e9e73b0cb9 Use Swift version 5.7 in PR checks
The version installed in the latest runner image, 5.7.1, is not yet
supported.
2022-11-22 11:30:27 +00:00
Angela P Wen
bab5a146ac Add Ruby and Swift language autodetect tests (#1369)
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-11-22 11:03:25 +00:00
Henry Mercer
6013661451 Update v1 deprecation date
The expected deprecation date of GHES 3.3 has been postponed, so v1 will
now be deprecated in January.
2022-11-22 09:43:07 +00:00
Andrew Eisenberg
26df9a9a4f Merge pull request #1384 from github/aeisenberg/feature-flags-disk
Cache feature flags on disk
2022-11-21 15:25:34 -08:00
Andrew Eisenberg
4ee97e5e55 Add extra test ensuring env var overrides cached feature flag 2022-11-21 14:30:36 -08:00
Andrew Eisenberg
cfce1c4e19 Rename 2022-11-21 13:42:32 -08:00
Andrew Eisenberg
da75623c67 Update changelog 2022-11-21 11:19:34 -08:00
Andrew Eisenberg
c29fca48a1 Cache feature flags on disk
This will allow feature flags to be shared across steps in the same job,
avoiding an error we saw earlier where the init action had the flag
enabled, but the analyze step had it disabled.

This uses the runner's temp folder to cache the flags file, which will
stick around until the job completes.
2022-11-21 11:14:38 -08:00
Angela P Wen
4fddc51e4f Support Kotlin for public beta (#1370) 2022-11-17 18:38:48 +00:00
Henry Mercer
7694d6752a Merge pull request #1378 from github/henrymercer/add-ruby-to-readme
Add Ruby to README
2022-11-17 12:39:38 +00:00
Marco Gario
3b8914b2cc Merge pull request #1376 from github/mergeback/v2.1.33-to-main-678fc3af
Mergeback v2.1.33 refs/heads/releases/v2 into main
2022-11-16 20:57:51 +01:00
github-actions[bot]
377b692bf3 Update checked-in dependencies 2022-11-16 18:49:58 +00:00
Henry Mercer
55a437c003 Add Ruby to README 2022-11-16 18:31:04 +00:00
github-actions[bot]
e353814da4 Update changelog and version after v2.1.33 2022-11-16 18:17:50 +00:00
Marco Gario
678fc3afe2 Merge pull request #1375 from github/update-v2.1.33-c939e661
Merge main into releases/v2
2022-11-16 19:15:58 +01:00
Henry Mercer
0f07790b74 Merge pull request #1374 from github/henrymercer/pass-testing-environment
Set testing environment for CodeQL workflow
2022-11-16 18:05:00 +00:00
Edoardo Pirovano
53060aa0c8 Merge pull request #1373 from github/edoardo/workaround-download
TRAP Caching: Re-introduce workaround for download timeout
2022-11-16 17:28:21 +00:00
Marco Gario
d13b9b8244 Fix changelog entry 2022-11-16 17:45:42 +01:00
Henry Mercer
a836d9571f Set testing environment for CodeQL workflow 2022-11-16 16:40:35 +00:00
Henry Mercer
ffc2dd6d6d Enable test mode for check-codescanning-config Action 2022-11-16 16:40:35 +00:00
Henry Mercer
7cdf75141e Remove redundant INTERNAL_CODEQL_ACTION_DEBUG_LOC variable 2022-11-16 16:40:35 +00:00
Henry Mercer
a190d3876a Rename TEST_MODE to specific variable for CodeQL Action
This allows us to set it automatically in the workflow generator,
simplifying things and reducing the scope for error.
2022-11-16 16:40:30 +00:00
github-actions[bot]
f2c3e7ca4e Update changelog for v2.1.33 2022-11-16 16:34:17 +00:00
Edoardo Pirovano
bfc56625b0 TRAP Caching: Re-introduce workaround for download timeout 2022-11-16 15:49:52 +00:00
Marco Gario
c939e6615d Merge pull request #1372 from github/marcogario/prioritize_github_ref
Prefer GITHUB_REF to CODE_SCANNING_REF
2022-11-16 12:03:29 +01:00
Henry Mercer
1935d19d61 Merge pull request #1358 from github/henrymercer/require-cli-2.6.3
Bump minimum CodeQL bundle version to 2.6.3
2022-11-16 10:37:57 +00:00
Angela P Wen
7484436e5d Remove Go extraction feature flags (#1371) 2022-11-16 10:32:40 +00:00
Marco Gario
0a76b97b28 Prefer GITHUB_REF to CODE_SCANNING_REF
Given that the GITHUB_REF is a protected variable, we want to prefer it to
CODE_SCANNING_REF. This should prevent accidentally overwriting these values.
The logic is a bit more involved, as I think it makes sense to raise the error
about GITHUB_REF not being set, rather than mentioning CODE_SCANNING_REF if
both are not set.
2022-11-16 10:49:49 +01:00
Henry Mercer
f8b607edaa Merge pull request #1364 from github/henrymercer/delete-runner-part-2
Delete the runner, part 2
2022-11-15 21:19:38 +00:00
Henry Mercer
d48707ce53 Merge branch 'henrymercer/delete-runner-part-2' into henrymercer/require-cli-2.6.3 2022-11-15 20:58:01 +00:00
Henry Mercer
07b9db6a46 Explicitly set up Go 1.13.1 in checks running on old runner images 2022-11-15 20:53:57 +00:00
Henry Mercer
0dea34e91c Merge branch 'main' into henrymercer/delete-runner-part-2 2022-11-15 19:35:30 +00:00
Henry Mercer
f47c93c5fd Merge pull request #1363 from github/henrymercer/delete-runner-part-1
Delete the runner, part 1
2022-11-15 19:31:28 +00:00
Andrew Eisenberg
6a0f768e01 Merge pull request #1368 from marcogario/marcogario/code_scanning_ref
Read CODE_SCANNING_REF env variable
2022-11-15 09:14:09 -08:00
Marco Gario
2bca6af0e5 Read CODE_SCANNING_REF 2022-11-15 15:26:47 +01:00
Henry Mercer
43f9bd3e4f Merge pull request #1365 from github/henrymercer/update-query-id-prefixes
Add Swift file baseline info to expected list
2022-11-15 14:20:42 +00:00
Henry Mercer
88b5c1e51f Set environment variable to enable Swift 2022-11-15 13:53:00 +00:00
Henry Mercer
3ef8b89353 Merge branch 'main' into henrymercer/update-query-id-prefixes 2022-11-15 13:46:12 +00:00
Henry Mercer
35086e72ed Merge pull request #1366 from github/henrymercer/update-lockfile
Update lockfiles to v3
2022-11-15 12:43:58 +00:00
Henry Mercer
1e2f8f035d Merge branch 'main' into henrymercer/require-cli-2.6.3 2022-11-14 22:25:31 +00:00
Henry Mercer
31c87302e7 Add Swift file baseline info to expected list
Also update query ID prefixes for C# and Ruby
2022-11-14 22:23:16 +00:00
Henry Mercer
0990a34ac8 Merge branch 'main' into henrymercer/delete-runner-part-1 2022-11-14 22:20:41 +00:00
Henry Mercer
47ce159207 Add config file to support npm v8 and v9 simultaneously 2022-11-14 22:15:08 +00:00
Angela P Wen
5883c13406 Deprecate Go extraction reconciliation feature flag and CODEQL_EXTRACTOR_GO_BUILD_TRACING for custom builds (#1322)
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-11-14 13:54:35 -08:00
Henry Mercer
375506c896 Update lockfiles to v3 2022-11-14 21:43:03 +00:00
Henry Mercer
9df773d1a3 Remove unneeded apiDetails input to getApiClient 2022-11-14 19:55:30 +00:00
Henry Mercer
dac8912e9f Remove deriveApiUrl function only used by runner 2022-11-14 18:59:39 +00:00
Henry Mercer
8ecbaea022 Remove support for empty analysis keys from runner 2022-11-14 18:55:31 +00:00
Henry Mercer
3d46406f3b Remove runner-only input to databaseInitCluster 2022-11-14 18:49:17 +00:00
Henry Mercer
03bb58c07d Remove note about separation in actions-util
We could move everything into `util`, but in some ways it is nice having
a file dedicated to Actions related utilities.
2022-11-14 18:46:43 +00:00
Angela P Wen
0eacdb53ad Support Swift for private beta (#1350)
Co-authored-by: Henry Mercer <henry.mercer@me.com>
2022-11-14 10:29:05 -08:00
Henry Mercer
8c8a9b1231 Remove auth method only used in runner 2022-11-14 16:39:43 +00:00
Henry Mercer
b498c79130 Remove concept of Actions / runner mode 2022-11-14 16:37:48 +00:00
Henry Mercer
51abddb49b Delete the runner 2022-11-14 16:23:14 +00:00
Henry Mercer
73c5c0607d Remove runner threads and RAM test
We don't need to test runner functionality now since the runner is only
used in PR checks, and `extractor-ram-threads.yml` covers the Action
case.
2022-11-14 16:18:38 +00:00
Henry Mercer
adb125ae03 Remove runner upload SARIF test
Testing SARIF compatibility is covered by `codeql.yml`.
2022-11-14 16:16:58 +00:00
Henry Mercer
219d9a0182 Remove runner C# autobuild tests
These are covered by `autobuild-action.yml`.
2022-11-14 16:14:41 +00:00
Henry Mercer
83ead4549c Remove manual build steps tests
These are tested by `multi-language-autodetect.yml`
2022-11-14 16:13:14 +00:00
Henry Mercer
63d8cbe20e Remove Windows and macOS JS analysis runner tests
These are covered by `codeql.yml`, which runs across all latest runner
images.
2022-11-14 16:09:36 +00:00
Henry Mercer
be84b68e4c Delete runner CLI config parsing check
This is now covered by `codescanning-config-cli.yml`.
2022-11-14 16:07:49 +00:00
Henry Mercer
af487b12e7 Merge pull request #1361 from github/mergeback/v2.1.32-to-main-42384213
Mergeback v2.1.32 refs/heads/releases/v2 into main
2022-11-14 13:42:07 +00:00
github-actions[bot]
f3e11b9174 Update checked-in dependencies 2022-11-14 12:58:46 +00:00
github-actions[bot]
ac90bc016d Update changelog and version after v2.1.32 2022-11-14 12:37:28 +00:00
Henry Mercer
4238421316 Merge pull request #1360 from github/update-v2.1.32-33b10be6
Merge main into releases/v2
2022-11-14 12:35:15 +00:00
github-actions[bot]
97be6233c4 Update changelog for v2.1.32 2022-11-14 12:03:19 +00:00
Henry Mercer
0c3e493df0 Update first version of CLI compatible with Windows 2022
It is 2.8.2, not 2.7.3.
2022-11-11 19:08:55 +00:00
Henry Mercer
e131232b86 Add changelog note 2022-11-11 19:08:33 +00:00
Henry Mercer
1fd76310fd Update CLI versions in non-generated checks 2022-11-11 19:08:33 +00:00
Henry Mercer
9e44100c47 Update autogenerated checks to run on earliest three minor CLI versions 2022-11-11 19:00:48 +00:00
Henry Mercer
acbc6ca6e5 Fix a couple of naming nits 2022-11-11 19:00:48 +00:00
Henry Mercer
84e5134df9 Remove lines of code counting in the Action
We now only need to support doing this in the CLI.
2022-11-11 19:00:45 +00:00
Henry Mercer
ea990a3118 Remove flags for CLI v2.6.2 and earlier 2022-11-11 18:22:45 +00:00
Henry Mercer
b45e925fe2 Bump minimum version to 2.6.3 2022-11-11 18:00:58 +00:00
Henry Mercer
33b10be6bf Merge pull request #1348 from github/henrymercer/use-codeql-2.11.3
Bump default CodeQL version to 2.11.3
2022-11-11 11:36:11 +00:00
Henry Mercer
718930badf Pin npm to latest v8 release to address failing PR check
npm v9 is not compatible with Node 12, so we can't update to it yet.
2022-11-11 11:06:50 +00:00
Henry Mercer
76a77405c1 Fix Python query identifier in file baseline information PR check 2022-11-11 10:12:39 +00:00
Henry Mercer
9452b6b864 Merge branch 'main' into henrymercer/use-codeql-2.11.3 2022-11-11 09:56:50 +00:00
Henry Mercer
dba70acdb3 Bump default CodeQL version to 2.11.3 2022-11-07 10:40:09 +00:00
9734 changed files with 1303887 additions and 1351457 deletions

View File

@@ -1,5 +1,4 @@
**/webpack.config.js
lib/**
runner/dist/**
src/testdata/**
tests/**

View File

@@ -16,7 +16,10 @@
"rules": {
"filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
"i18n-text/no-en": "off",
"import/extensions": "error",
"import/extensions": ["error", {
// Allow importing JSON files
"json": {}
}],
"import/no-amd": "error",
"import/no-commonjs": "error",
"import/no-dynamic-require": "error",
@@ -30,6 +33,12 @@
"alphabetize": {"order": "asc"},
"newlines-between": "always"
}],
"max-len": ["error", {
"code": 120,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}],
"no-async-foreach/no-async-foreach": "error",
"no-console": "off",
"no-sequences": "error",
@@ -55,5 +64,13 @@
"func-style": "off",
"sort-imports": "off"
}
}]
}],
"settings": {
"import/resolver": {
"node": {
"moduleDirectory": ["node_modules", "src"]
},
"typescript": {}
}
}
}

View File

@@ -0,0 +1,62 @@
name: Check Code-Scanning Config
description: |
Checks the code scanning configuration file generated by the
action to ensure it contains the expected contents
inputs:
languages:
required: false
description: The languages field passed to the init action.
packs:
required: false
description: The packs field passed to the init action.
queries:
required: false
description: The queries field passed to the init action.
config-file-test:
required: false
description: |
The location of the config file to use. If empty,
then no config file is used.
expected-config-file-contents:
required: true
description: |
A JSON string containing the exact contents of the config file.
tools:
required: true
description: |
The url of codeql to use.
runs:
using: composite
steps:
- uses: ./../action/init
with:
languages: ${{ inputs.languages }}
config-file: ${{ inputs.config-file-test }}
queries: ${{ inputs.queries }}
packs: ${{ inputs.packs }}
tools: ${{ inputs.tools }}
db-location: ${{ runner.temp }}/codescanning-config-cli-test
env:
CODEQL_ACTION_TEST_MODE: 'true'
- name: Install dependencies
shell: bash
run: npm install --location=global ts-node js-yaml
- name: Check config
working-directory: ${{ github.action_path }}
shell: bash
run: ts-node ./index.ts "${{ runner.temp }}/user-config.yaml" '${{ inputs.expected-config-file-contents }}'
- name: Clean up
shell: bash
if: always()
run: |
rm -rf ${{ runner.temp }}/codescanning-config-cli-test
rm -rf ${{ runner.temp }}/user-config.yaml

42
.github/actions/prepare-test/action.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: "Prepare test"
description: Performs some preparation to run tests
inputs:
version:
description: "The version of the CodeQL CLI to use. Can be 'latest', 'cached', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
required: true
outputs:
tools-url:
description: "The value that should be passed as the 'tools' input of the 'init' step."
value: ${{ steps.get-url.outputs.tools-url }}
runs:
using: composite
steps:
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- id: get-url
name: Determine URL
shell: bash
run: |
set -e # Fail this Action if `gh release list` fails.
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
export LATEST=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == *"nightly"* ]]; then
export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$VERSION-manual/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == *"stable"* ]]; then
export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$VERSION/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == "latest" ]]; then
echo "tools-url=latest" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == "cached" ]]; then
echo "tools-url=" >> $GITHUB_OUTPUT
else
echo "::error::Unrecognized version specified!"
exit 1
fi

View File

@@ -0,0 +1,54 @@
name: Query Filter Test
description: Runs a test of query filters using the check SARIF action
inputs:
sarif-file:
required: true
description: The SARIF file to check
queries-run:
required: true
description: |
Comma separated list of query ids that should be included in this SARIF file.
queries-not-run:
required: true
description: |
Comma separated list of query ids that should NOT be included in this SARIF file.
config-file:
required: true
description: |
The location of the codeql configuration file to use.
tools:
required: true
description: |
The url of codeql to use.
runs:
using: composite
steps:
- uses: ./../action/init
with:
languages: javascript
config-file: ${{ inputs.config-file }}
tools: ${{ inputs.tools }}
db-location: ${{ runner.temp }}/query-filter-test
env:
CODEQL_ACTION_TEST_MODE: "true"
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
upload: never
env:
CODEQL_ACTION_TEST_MODE: "true"
- name: Check SARIF
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ inputs.sarif-file }}
queries-run: ${{ inputs.queries-run}}
queries-not-run: ${{ inputs.queries-not-run}}
- name: Cleanup after test
shell: bash
run: rm -rf "$RUNNER_TEMP/results" "$RUNNER_TEMP/query-filter-test"

32
.github/actions/setup-swift/action.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: "Set up Swift"
description: Sets up an appropriate Swift version if Swift is enabled via CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT.
inputs:
codeql-path:
description: Path to the CodeQL CLI executable.
required: true
runs:
using: "composite"
steps:
- name: Get Swift version
id: get_swift_version
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true'
shell: bash
env:
CODEQL_PATH: ${{ inputs.codeql-path }}
run: |
if [ $RUNNER_OS = "macOS" ]; then
PLATFORM="osx64"
else # We do not run this step on Windows.
PLATFORM="linux64"
fi
SWIFT_EXTRACTOR_DIR="$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]')"
VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor" --version | awk '/version/ { print $3 }')"
# Specify 5.7.0, otherwise setup Action will default to latest minor version.
if [ $VERSION = "5.7" ]; then
VERSION="5.7.0"
fi
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
- uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true'
with:
swift-version: "${{ steps.get_swift_version.outputs.version }}"

View File

@@ -0,0 +1,14 @@
name: Update default CodeQL bundle
description: Updates 'src/defaults.json' to point to a new CodeQL bundle release.
runs:
using: composite
steps:
- name: Install ts-node
shell: bash
run: npm install -g ts-node
- name: Run update script
working-directory: ${{ github.action_path }}
shell: bash
run: ts-node ./index.ts

67
.github/actions/update-bundle/index.ts vendored Normal file
View File

@@ -0,0 +1,67 @@
import * as fs from 'fs';
import * as github from '@actions/github';
interface BundleInfo {
bundleVersion: string;
cliVersion: string;
}
interface Defaults {
bundleVersion: string;
cliVersion: string;
priorBundleVersion: string;
priorCliVersion: string;
}
function getCodeQLCliVersionForRelease(release): string {
// We do not currently tag CodeQL bundles based on the CLI version they contain.
// Instead, we use a marker file `cli-version-<version>.txt` to record the CLI version.
// This marker file is uploaded as a release asset for all new CodeQL bundles.
const cliVersionsFromMarkerFiles = release.assets
.map((asset) => asset.name.match(/cli-version-(.*)\.txt/)?.[1])
.filter((v) => v)
.map((v) => v as string);
if (cliVersionsFromMarkerFiles.length > 1) {
throw new Error(
`Release ${release.tag_name} has multiple CLI version marker files.`
);
} else if (cliVersionsFromMarkerFiles.length === 0) {
throw new Error(
`Failed to find the CodeQL CLI version for release ${release.tag_name}.`
);
}
return cliVersionsFromMarkerFiles[0];
}
async function getBundleInfoFromRelease(release): Promise<BundleInfo> {
return {
bundleVersion: release.tag_name,
cliVersion: getCodeQLCliVersionForRelease(release)
};
}
async function getNewDefaults(currentDefaults: Defaults): Promise<Defaults> {
const release = github.context.payload.release;
console.log('Updating default bundle as a result of the following release: ' +
`${JSON.stringify(release)}.`)
const bundleInfo = await getBundleInfoFromRelease(release);
return {
bundleVersion: bundleInfo.bundleVersion,
cliVersion: bundleInfo.cliVersion,
priorBundleVersion: currentDefaults.bundleVersion,
priorCliVersion: currentDefaults.cliVersion
};
}
async function main() {
const previousDefaults: Defaults = JSON.parse(fs.readFileSync('../../../src/defaults.json', 'utf8'));
const newDefaults = await getNewDefaults(previousDefaults);
// Update the source file in the repository. Calling workflows should subsequently rebuild
// the Action to update `lib/defaults.json`.
fs.writeFileSync('../../../src/defaults.json', JSON.stringify(newDefaults, null, 2) + "\n");
}
// Ideally, we'd await main() here, but that doesn't work well with `ts-node`.
// So instead we rely on the fact that Node won't exit until the event loop is empty.
main();

View File

@@ -1,60 +0,0 @@
name: Check Code-Scanning Config
description: |
Checks the code scanning configuration file generated by the
action to ensure it contains the expected contents
inputs:
languages:
required: false
description: The languages field passed to the init action.
packs:
required: false
description: The packs field passed to the init action.
queries:
required: false
description: The queries field passed to the init action.
config-file-test:
required: false
description: |
The location of the config file to use. If empty,
then no config file is used.
expected-config-file-contents:
required: true
description: |
A JSON string containing the exact contents of the config file.
tools:
required: true
description: |
The url of codeql to use.
runs:
using: composite
steps:
- uses: ./../action/init
with:
languages: ${{ inputs.languages }}
config-file: ${{ inputs.config-file-test }}
queries: ${{ inputs.queries }}
packs: ${{ inputs.packs }}
tools: ${{ inputs.tools }}
db-location: ${{ runner.temp }}/codescanning-config-cli-test
- name: Install dependencies
shell: bash
run: npm install --location=global ts-node js-yaml
- name: Check config
working-directory: ${{ github.action_path }}
shell: bash
run: ts-node ./index.ts "${{ runner.temp }}/user-config.yaml" '${{ inputs.expected-config-file-contents }}'
- name: Clean up
shell: bash
if: always()
run: |
rm -rf ${{ runner.temp }}/codescanning-config-cli-test
rm -rf ${{ runner.temp }}/user-config.yaml

View File

@@ -7,6 +7,7 @@ queries:
# we include both even though one is a superset of the
# other, because we're testing the parsing logic and
# that the suites exist in the codeql bundle.
- uses: security-experimental
- uses: security-extended
- uses: security-and-quality
paths-ignore:

View File

@@ -1,20 +1,21 @@
version: 2
updates:
- package-ecosystem: "npm"
- package-ecosystem: npm
directory: "/"
schedule:
interval: "weekly"
day: "thursday" # Gives us a working day to merge this before our typical release
interval: weekly
labels:
- "Update dependencies"
- Update dependencies
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "npm"
directory: "/runner"
update-types:
- version-update:semver-minor
- version-update:semver-patch
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "weekly"
day: "thursday" # Gives us a working day to merge this before our typical release
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
interval: weekly
- package-ecosystem: github-actions
directory: "/.github/actions/setup-swift/" # All subdirectories outside of "/.github/workflows" must be explicitly included.
schedule:
interval: weekly

View File

@@ -1,38 +0,0 @@
name: "Prepare test"
description: Performs some preparation to run tests
inputs:
version:
required: true
outputs:
tools-url:
value: ${{ steps.get-url.outputs.tools-url }}
runs:
using: composite
steps:
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- id: get-url
name: Determine URL
shell: bash
run: |
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
export LATEST=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == *"nightly"* ]]; then
export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$VERSION-manual/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == *"stable"* ]]; then
export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$VERSION/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == "latest" ]]; then
echo "tools-url=latest" >> $GITHUB_OUTPUT
elif [[ ${{ inputs.version }} == "cached" ]]; then
echo "tools-url=" >> $GITHUB_OUTPUT
else
echo "::error Unrecognized version specified!"
fi

View File

@@ -1,54 +0,0 @@
name: Query Filter Test
description: Runs a test of query filters using the check SARIF action
inputs:
sarif-file:
required: true
description: The SARIF file to check
queries-run:
required: true
description: |
Comma separated list of query ids that should be included in this SARIF file.
queries-not-run:
required: true
description: |
Comma separated list of query ids that should NOT be included in this SARIF file.
config-file:
required: true
description: |
The location of the codeql configuration file to use.
tools:
required: true
description: |
The url of codeql to use.
runs:
using: composite
steps:
- uses: ./../action/init
with:
languages: javascript
config-file: ${{ inputs.config-file }}
tools: ${{ inputs.tools }}
db-location: ${{ runner.temp }}/query-filter-test
env:
TEST_MODE: "true"
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
upload: false
env:
TEST_MODE: "true"
- name: Check SARIF
uses: ./../action/.github/check-sarif
with:
sarif-file: ${{ inputs.sarif-file }}
queries-run: ${{ inputs.queries-run}}
queries-not-run: ${{ inputs.queries-not-run}}
- name: Cleanup after test
shell: bash
run: rm -rf "$RUNNER_TEMP/results" "$RUNNER_TEMP/query-filter-test"

View File

@@ -5,7 +5,7 @@ import json
import os
import subprocess
EMPTY_CHANGELOG = """# CodeQL Action and CodeQL Runner Changelog
EMPTY_CHANGELOG = """# CodeQL Action Changelog
## [UNRELEASED]
@@ -13,14 +13,8 @@ No user facing changes.
"""
# Value of the mode flag for a v1 release
V1_MODE = 'v1-release'
# Value of the mode flag for a v2 release
V2_MODE = 'v2-release'
SOURCE_BRANCH_FOR_MODE = { V1_MODE: 'releases/v2', V2_MODE: 'main' }
TARGET_BRANCH_FOR_MODE = { V1_MODE: 'releases/v1', V2_MODE: 'releases/v2' }
SOURCE_BRANCH = 'main'
TARGET_BRANCH = 'releases/v2'
# Name of the remote
ORIGIN = 'origin'
@@ -32,7 +26,7 @@ def run_git(*args, allow_non_zero_exit_code=False):
cmd = ['git', *args]
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if not allow_non_zero_exit_code and p.returncode != 0:
raise Exception('Call to ' + ' '.join(cmd) + ' exited with code ' + str(p.returncode) + ' stderr:' + p.stderr.decode('ascii'))
raise Exception(f'Call to {" ".join(cmd)} exited with code {p.returncode} stderr: {p.stderr.decode("ascii")}.')
return p.stdout.decode('ascii')
# Returns true if the given branch exists on the origin remote
@@ -40,23 +34,21 @@ def branch_exists_on_remote(branch_name):
return run_git('ls-remote', '--heads', ORIGIN, branch_name).strip() != ''
# Opens a PR from the given branch to the target branch
def open_pr(
repo, all_commits, source_branch_short_sha, new_branch_name, source_branch, target_branch,
conductor, is_v2_release, labels, conflicted_files):
def open_pr(repo, all_commits, source_branch_short_sha, new_branch_name, conductor):
# Sort the commits into the pull requests that introduced them,
# and any commits that don't have a pull request
pull_requests = []
commits_without_pull_requests = []
for commit in all_commits:
pr = get_pr_for_commit(repo, commit)
pr = get_pr_for_commit(commit)
if pr is None:
commits_without_pull_requests.append(commit)
elif not any(p for p in pull_requests if p.number == pr.number):
pull_requests.append(pr)
print('Found ' + str(len(pull_requests)) + ' pull requests')
print('Found ' + str(len(commits_without_pull_requests)) + ' commits not in a pull request')
print(f'Found {len(pull_requests)} pull requests.')
print(f'Found {len(commits_without_pull_requests)} commits not in a pull request.')
# Sort PRs and commits by age
pull_requests = sorted(pull_requests, key=lambda pr: pr.number)
@@ -64,7 +56,7 @@ def open_pr(
# Start constructing the body text
body = []
body.append('Merging ' + source_branch_short_sha + ' into ' + target_branch)
body.append(f'Merging {source_branch_short_sha} into {TARGET_BRANCH}.')
body.append('')
body.append(f'Conductor for this PR is @{conductor}.')
@@ -87,50 +79,33 @@ def open_pr(
body.append('')
body.append('Please do the following:')
if len(conflicted_files) > 0:
body.append(' - [ ] Ensure `package.json` file contains the correct version.')
body.append(' - [ ] Add commits to this branch to resolve the merge conflicts ' +
'in the following files:')
body.extend([f' - [ ] `{file}`' for file in conflicted_files])
body.append(' - [ ] Ensure another maintainer has reviewed the additional commits you added to this ' +
'branch to resolve the merge conflicts.')
body.append(' - [ ] Ensure the CHANGELOG displays the correct version and date.')
body.append(' - [ ] Ensure the CHANGELOG includes all relevant, user-facing changes since the last release.')
body.append(' - [ ] Check that there are not any unexpected commits being merged into the ' + target_branch + ' branch.')
body.append(f' - [ ] Check that there are not any unexpected commits being merged into the {TARGET_BRANCH} branch.')
body.append(' - [ ] Ensure the docs team is aware of any documentation changes that need to be released.')
if not is_v2_release:
body.append(' - [ ] Remove and re-add the "Update dependencies" label to the PR to trigger just this workflow.')
body.append(' - [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies.')
body.append(' - [ ] Mark the PR as ready for review to trigger the full set of PR checks.')
body.append(' - [ ] Approve and merge this PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.')
body.append(' - [ ] Merge the mergeback PR that will automatically be created once this PR is merged.')
if is_v2_release:
body.append(' - [ ] Merge the mergeback PR that will automatically be created once this PR is merged.')
body.append(' - [ ] Merge the v1 release PR that will automatically be created once this PR is merged.')
title = 'Merge ' + source_branch + ' into ' + target_branch
title = f'Merge {SOURCE_BRANCH} into {TARGET_BRANCH}'
# Create the pull request
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft so that
# a maintainer can take the PR out of draft, thereby triggering the PR checks.
pr = repo.create_pull(title=title, body='\n'.join(body), head=new_branch_name, base=target_branch, draft=True)
pr.add_to_labels(*labels)
print('Created PR #' + str(pr.number))
pr = repo.create_pull(title=title, body='\n'.join(body), head=new_branch_name, base=TARGET_BRANCH, draft=True)
print(f'Created PR #{pr.number}')
# Assign the conductor
pr.add_to_assignees(conductor)
print('Assigned PR to ' + conductor)
print(f'Assigned PR to {conductor}')
# Gets a list of the SHAs of all commits that have happened on the source branch
# since the last release to the target branch.
# This will not include any commits that exist on the target branch
# that aren't on the source branch.
def get_commit_difference(repo, source_branch, target_branch):
def get_commit_difference(repo):
# Passing split nothing means that the empty string splits to nothing: compare `''.split() == []`
# to `''.split('\n') == ['']`.
commits = run_git('log', '--pretty=format:%H', ORIGIN + '/' + target_branch + '..' + ORIGIN + '/' + source_branch).strip().split()
commits = run_git('log', '--pretty=format:%H', f'{ORIGIN}/{TARGET_BRANCH}..{ORIGIN}/{SOURCE_BRANCH}').strip().split()
# Convert to full-fledged commit objects
commits = [repo.get_commit(c) for c in commits]
@@ -146,13 +121,13 @@ def is_pr_merge_commit(commit):
def get_truncated_commit_message(commit):
message = commit.commit.message.split('\n')[0]
if len(message) > 60:
return message[:57] + '...'
return f'{message[:57]}...'
else:
return message
# Converts a commit into the PR that introduced it to the source branch.
# Returns the PR object, or None if no PR could be found.
def get_pr_for_commit(repo, commit):
def get_pr_for_commit(commit):
prs = commit.get_pulls()
if prs.totalCount > 0:
@@ -186,7 +161,7 @@ def update_changelog(version):
else:
content = EMPTY_CHANGELOG
newContent = content.replace('[UNRELEASED]', version + ' - ' + get_today_string(), 1)
newContent = content.replace('[UNRELEASED]', f'{version} - {get_today_string()}', 1)
with open('CHANGELOG.md', 'w') as f:
f.write(newContent)
@@ -207,16 +182,6 @@ def main():
required=True,
help='The nwo of the repository, for example github/codeql-action.'
)
parser.add_argument(
'--mode',
type=str,
required=True,
choices=[V2_MODE, V1_MODE],
help=f"Which release to perform. '{V2_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V2_MODE]} as the source " +
f"branch and {TARGET_BRANCH_FOR_MODE[V2_MODE]} as the target branch. " +
f"'{V1_MODE}' uses {SOURCE_BRANCH_FOR_MODE[V1_MODE]} as the source branch and " +
f"{TARGET_BRANCH_FOR_MODE[V1_MODE]} as the target branch."
)
parser.add_argument(
'--conductor',
type=str,
@@ -226,110 +191,46 @@ def main():
args = parser.parse_args()
source_branch = SOURCE_BRANCH_FOR_MODE[args.mode]
target_branch = TARGET_BRANCH_FOR_MODE[args.mode]
repo = Github(args.github_token).get_repo(args.repository_nwo)
version = get_current_version()
if args.mode == V1_MODE:
# Change the version number to a v1 equivalent
version = get_current_version()
version = f'1{version[1:]}'
# Print what we intend to go
print('Considering difference between ' + source_branch + ' and ' + target_branch)
source_branch_short_sha = run_git('rev-parse', '--short', ORIGIN + '/' + source_branch).strip()
print('Current head of ' + source_branch + ' is ' + source_branch_short_sha)
print(f'Considering difference between {SOURCE_BRANCH} and {TARGET_BRANCH}...')
source_branch_short_sha = run_git('rev-parse', '--short', f'{ORIGIN}/{SOURCE_BRANCH}').strip()
print(f'Current head of {SOURCE_BRANCH} is {source_branch_short_sha}.')
# See if there are any commits to merge in
commits = get_commit_difference(repo=repo, source_branch=source_branch, target_branch=target_branch)
commits = get_commit_difference(repo=repo)
if len(commits) == 0:
print('No commits to merge from ' + source_branch + ' to ' + target_branch)
print(f'No commits to merge from {SOURCE_BRANCH} to {TARGET_BRANCH}.')
return
# The branch name is based off of the name of branch being merged into
# and the SHA of the branch being merged from. Thus if the branch already
# exists we can assume we don't need to recreate it.
new_branch_name = 'update-v' + version + '-' + source_branch_short_sha
print('Branch name is ' + new_branch_name)
new_branch_name = f'update-v{version}-{source_branch_short_sha}'
print(f'Branch name is {new_branch_name}.')
# Check if the branch already exists. If so we can abort as this script
# has already run on this combination of branches.
if branch_exists_on_remote(new_branch_name):
print('Branch ' + new_branch_name + ' already exists. Nothing to do.')
print(f'Branch {new_branch_name} already exists. Nothing to do.')
return
# Create the new branch and push it to the remote
print('Creating branch ' + new_branch_name)
print(f'Creating branch {new_branch_name}.')
# The process of creating the v1 release can run into merge conflicts. We commit the unresolved
# conflicts so a maintainer can easily resolve them (vs erroring and requiring maintainers to
# reconstruct the release manually)
conflicted_files = []
# If we're performing a standard release, there won't be any new commits on the target branch,
# as these will have already been merged back into the source branch. Therefore we can just
# start from the source branch.
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{SOURCE_BRANCH}')
if args.mode == V1_MODE:
# If we're performing a backport, start from the target branch
print(f'Creating {new_branch_name} from the {ORIGIN}/{target_branch} branch')
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{target_branch}')
print('Updating changelog')
update_changelog(version)
# Revert the commit that we made as part of the last release that updated the version number and
# changelog to refer to 1.x.x variants. This avoids merge conflicts in the changelog and
# package.json files when we merge in the v2 branch.
# This commit will not exist the first time we release the v1 branch from the v2 branch, so we
# use `git log --grep` to conditionally revert the commit.
print('Reverting the 1.x.x version number and changelog updates from the last release to avoid conflicts')
v1_update_commits = run_git('log', '--grep', '^Update version and changelog for v', '--format=%H').split()
if len(v1_update_commits) > 0:
print(f' Reverting {v1_update_commits[0]}')
# Only revert the newest commit as older ones will already have been reverted in previous
# releases.
run_git('revert', v1_update_commits[0], '--no-edit')
# Also revert the "Update checked-in dependencies" commit created by Actions.
update_dependencies_commit = run_git('log', '--grep', '^Update checked-in dependencies', '--format=%H').split()[0]
print(f' Reverting {update_dependencies_commit}')
run_git('revert', update_dependencies_commit, '--no-edit')
else:
print(' Nothing to revert.')
print(f'Merging {ORIGIN}/{source_branch} into the release prep branch')
# Commit any conflicts (see the comment for `conflicted_files`)
run_git('merge', f'{ORIGIN}/{source_branch}', allow_non_zero_exit_code=True)
conflicted_files = run_git('diff', '--name-only', '--diff-filter', 'U').splitlines()
if len(conflicted_files) > 0:
run_git('add', '.')
run_git('commit', '--no-edit')
# Migrate the package version number from a v2 version number to a v1 version number
print(f'Setting version number to {version}')
subprocess.check_output(['npm', 'version', version, '--no-git-tag-version'])
run_git('add', 'package.json', 'package-lock.json')
# Migrate the changelog notes from v2 version numbers to v1 version numbers
print('Migrating changelog notes from v2 to v1')
subprocess.check_output(['sed', '-i', 's/^## 2\./## 1./g', 'CHANGELOG.md'])
# Remove changelog notes from v2 that don't apply to v1
subprocess.check_output(['sed', '-i', '/^- \[v2+ only\]/d', 'CHANGELOG.md'])
# Amend the commit generated by `npm version` to update the CHANGELOG
run_git('add', 'CHANGELOG.md')
run_git('commit', '-m', f'Update version and changelog for v{version}')
else:
# If we're performing a standard release, there won't be any new commits on the target branch,
# as these will have already been merged back into the source branch. Therefore we can just
# start from the source branch.
run_git('checkout', '-b', new_branch_name, f'{ORIGIN}/{source_branch}')
print('Updating changelog')
update_changelog(version)
# Create a commit that updates the CHANGELOG
run_git('add', 'CHANGELOG.md')
run_git('commit', '-m', f'Update changelog for v{version}')
# Create a commit that updates the CHANGELOG
run_git('add', 'CHANGELOG.md')
run_git('commit', '-m', f'Update changelog for v{version}')
run_git('push', ORIGIN, new_branch_name)
@@ -339,12 +240,7 @@ def main():
commits,
source_branch_short_sha,
new_branch_name,
source_branch=source_branch,
target_branch=target_branch,
conductor=args.conductor,
is_v2_release=args.mode == V2_MODE,
labels=['Update dependencies'] if args.mode == V1_MODE else [],
conflicted_files=conflicted_files
)
if __name__ == '__main__':

View File

@@ -7,11 +7,11 @@ name: "PR Check - Analyze: 'ref' and 'sha' from inputs"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -25,24 +25,30 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: ubuntu-latest
version: stable-20220401
- os: macos-latest
version: stable-20210308
- os: windows-2019
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
version: stable-20220401
- os: windows-latest
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20210319
- os: windows-2019
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
version: stable-20220615
- os: windows-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20210809
- os: windows-2019
version: stable-20210809
version: stable-20220908
- os: windows-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: windows-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
@@ -69,25 +75,33 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: cpp,csharp,java,javascript,python
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
github.sha }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
env:
TEST_MODE: true
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - autobuild-action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -39,15 +39,24 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: csharp
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/autobuild
env:
# Explicitly disable the CLR tracer.
@@ -58,8 +67,8 @@ jobs:
CORECLR_PROFILER: ''
CORECLR_PROFILER_PATH_64: ''
- uses: ./../action/analyze
env:
TEST_MODE: true
with:
upload-database: false
- name: Check database
shell: bash
run: |
@@ -69,4 +78,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

106
.github/workflows/__config-export.yml generated vendored Normal file
View File

@@ -0,0 +1,106 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: PR Check - Config export
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
config-export:
strategy:
matrix:
include:
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: Config export
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: javascript
queries: security-extended
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@v3
with:
name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif
retention-days: 7
- name: Check config properties appear in SARIF
uses: actions/github-script@v6
env:
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
with:
script: |
const fs = require('fs');
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
const run = sarif.runs[0];
const configSummary = run.properties.codeqlConfigSummary;
if (configSummary === undefined) {
core.setFailed('`codeqlConfigSummary` property not found in the SARIF run property bag.');
}
if (configSummary.disableDefaultQueries !== false) {
core.setFailed('`disableDefaultQueries` property incorrect: expected false, got ' +
`${JSON.stringify(configSummary.disableDefaultQueries)}.`);
}
const expectedQueries = [{ type: 'builtinSuite', uses: 'security-extended' }];
// Use JSON.stringify to deep-equal the arrays.
if (JSON.stringify(configSummary.queries) !== JSON.stringify(expectedQueries)) {
core.setFailed(`\`queries\` property incorrect: expected ${JSON.stringify(expectedQueries)}, got ` +
`${JSON.stringify(configSummary.queries)}.`);
}
core.info('Finished config export tests.');
env:
CODEQL_ACTION_EXPORT_CODE_SCANNING_CONFIG: true
CODEQL_PASS_CONFIG_TO_CLI: true
CODEQL_ACTION_TEST_MODE: true

151
.github/workflows/__diagnostics-export.yml generated vendored Normal file
View File

@@ -0,0 +1,151 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: PR Check - Diagnostic export
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
diagnostics-export:
strategy:
matrix:
include:
- os: ubuntu-latest
version: stable-20230317
- os: macos-latest
version: stable-20230317
- os: windows-latest
version: stable-20230317
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: Diagnostic export
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
id: init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Add test diagnostics
shell: bash
env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
run: |
for i in {1..2}; do
# Use the same location twice to test the workaround for the bug in CodeQL CLI 2.12.5 that
# produces an invalid diagnostic with multiple identical location objects.
"$CODEQL_PATH" database add-diagnostic \
"$RUNNER_TEMP/codeql_databases/javascript" \
--file-path /path/to/file \
--plaintext-message "Plaintext message $i" \
--source-id "lang/diagnostics/example" \
--source-name "Diagnostic name" \
--ready-for-status-page
done
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@v3
with:
name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif
retention-days: 7
- name: Check diagnostics appear in SARIF
uses: actions/github-script@v6
env:
SARIF_PATH: ${{ runner.temp }}/results/javascript.sarif
with:
script: |
const fs = require('fs');
function checkStatusPageNotification(n) {
const expectedMessage = 'Plaintext message 1\n\nCodeQL also found 1 other diagnostic like this. See the workflow log for details.';
if (n.message.text !== expectedMessage) {
core.setFailed(`Expected the status page diagnostic to have the message '${expectedMessage}', but found '${n.message.text}'.`);
}
if (n.locations.length !== 1) {
core.setFailed(`Expected the status page diagnostic to have exactly 1 location, but found ${n.locations.length}.`);
}
}
const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8'));
const run = sarif.runs[0];
const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications;
const statusPageNotifications = toolExecutionNotifications.filter(n =>
n.descriptor.id === 'lang/diagnostics/example' && n.properties?.visibility?.statusPage
);
if (statusPageNotifications.length !== 1) {
core.setFailed(
'Expected exactly one status page reporting descriptor for this diagnostic in the ' +
`'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` +
`${statusPageNotifications.length}. All notification reporting descriptors: ` +
`${JSON.stringify(toolExecutionNotifications)}.`
);
}
checkStatusPageNotification(statusPageNotifications[0]);
const notifications = run.tool.driver.notifications;
const diagnosticNotification = notifications.filter(n =>
n.id === 'lang/diagnostics/example' && n.name === 'lang/diagnostics/example' &&
n.fullDescription.text === 'Diagnostic name'
);
if (diagnosticNotification.length !== 1) {
core.setFailed(
'Expected exactly one notification for this diagnostic in the ' +
`'runs[].tool.driver.notifications[]' SARIF property, but found ` +
`${diagnosticNotification.length}. All notifications: ` +
`${JSON.stringify(notifications)}.`
);
}
core.info('Finished diagnostic export test');
env:
CODEQL_ACTION_EXPORT_DIAGNOSTICS: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - Export file baseline information
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -39,16 +39,30 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
id: init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
CODEQL_FILE_BASELINE_INFORMATION: true
TEST_MODE: true
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{steps.init.outputs.codeql-path}}
- name: Build code
shell: bash
run: ./build.sh
@@ -57,7 +71,6 @@ jobs:
output: ${{ runner.temp }}/results
env:
CODEQL_FILE_BASELINE_INFORMATION: true
TEST_MODE: true
- name: Upload SARIF
uses: actions/upload-artifact@v3
with:
@@ -68,7 +81,10 @@ jobs:
shell: bash
run: |
cd "$RUNNER_TEMP/results"
expected_baseline_languages="cpp csharp go java js python ruby"
expected_baseline_languages="cpp cs go java js py rb"
if [[ $RUNNER_OS != "Windows" ]]; then
expected_baseline_languages+=" swift"
fi
for lang in ${expected_baseline_languages}; do
rule_name="${lang}/baseline/expected-extracted-files"
@@ -82,4 +98,4 @@ jobs:
fi
done
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - Extractor ram and threads options test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -35,16 +35,25 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: java
ram: 230
threads: 1
env:
TEST_MODE: true
- name: Assert Results
shell: bash
run: |
@@ -65,4 +74,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: 'PR Check - Go: Custom queries'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -25,24 +25,30 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: ubuntu-latest
version: stable-20220401
- os: macos-latest
version: stable-20210308
- os: windows-2019
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
version: stable-20220401
- os: windows-latest
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20210319
- os: windows-2019
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
version: stable-20220615
- os: windows-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20210809
- os: windows-2019
version: stable-20210809
version: stable-20220908
- os: windows-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: windows-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
@@ -69,25 +75,31 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v3
with:
go-version: ^1.13.1
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: go
config-file: ./.github/codeql/custom-queries.yml
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
env:
TEST_MODE: true
with:
upload-database: false
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -1,86 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: 'PR Check - Go: Autobuild custom tracing'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
go-custom-tracing-autobuild:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: macos-latest
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
- os: macos-latest
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
- os: macos-latest
version: stable-20210809
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: 'Go: Autobuild custom tracing'
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v3
with:
go-version: ^1.13.1
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/autobuild
- uses: ./../action/analyze
env:
TEST_MODE: true
- shell: bash
run: |
cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d go ]]; then
echo "Did not find a Go database"
exit 1
fi
env:
CODEQL_EXTRACTOR_GO_BUILD_TRACING: on
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -1,92 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: 'PR Check - Go: Custom tracing'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
go-custom-tracing:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: macos-latest
version: stable-20210308
- os: windows-2019
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
- os: macos-latest
version: stable-20210319
- os: windows-2019
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
- os: macos-latest
version: stable-20210809
- os: windows-2019
version: stable-20210809
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: windows-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: 'Go: Custom tracing'
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v3
with:
go-version: ^1.13.1
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: go build main.go
- uses: ./../action/analyze
env:
TEST_MODE: true
env:
CODEQL_EXTRACTOR_GO_BUILD_TRACING: on
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -1,91 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: 'PR Check - Go: Reconciled tracing with autobuilder'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
go-reconciled-tracing-autobuilder:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: macos-latest
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
- os: macos-latest
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
- os: macos-latest
version: stable-20210809
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: 'Go: Reconciled tracing with autobuilder'
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v3
with:
go-version: ^1.13.1
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/autobuild
- uses: ./../action/analyze
env:
TEST_MODE: true
- shell: bash
run: |
if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then
echo "Expected the Go autobuilder to be run, but the" \
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was not true."
exit 1
fi
cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d go ]]; then
echo "Did not find a Go database"
exit 1
fi
env:
CODEQL_ACTION_RECONCILE_GO_EXTRACTION: 'true'
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -1,108 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: 'PR Check - Go: Reconciled tracing with custom build steps'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
go-reconciled-tracing-custom-build-steps:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: macos-latest
version: stable-20210308
- os: windows-2019
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
- os: macos-latest
version: stable-20210319
- os: windows-2019
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
- os: macos-latest
version: stable-20210809
- os: windows-2019
version: stable-20210809
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: windows-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
- os: windows-latest
version: nightly-latest
name: 'Go: Reconciled tracing with custom build steps'
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v3
with:
go-version: ^1.13.1
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: go build main.go
- uses: ./../action/analyze
env:
TEST_MODE: true
- shell: bash
run: |
# Once we start running Bash 4.2 in all environments, we can replace the
# `! -z` flag with the more elegant `-v` which confirms that the variable
# is actually unset and not potentially set to a blank value.
if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then
echo "Expected the Go autobuilder not to be run, but the" \
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
exit 1
fi
cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d go ]]; then
echo "Did not find a Go database"
exit 1
fi
env:
# Enable reconciled Go tracing beta functionality
CODEQL_ACTION_RECONCILE_GO_EXTRACTION: 'true'
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -1,86 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: 'PR Check - Go: Reconciled tracing with legacy workflow'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
go-reconciled-tracing-legacy-workflow:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: macos-latest
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
- os: macos-latest
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
- os: macos-latest
version: stable-20210809
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: 'Go: Reconciled tracing with legacy workflow'
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v3
with:
go-version: ^1.13.1
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/analyze
env:
TEST_MODE: true
- shell: bash
run: |
cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d go ]]; then
echo "Did not find a Go database"
exit 1
fi
env:
# Enable reconciled Go tracing beta functionality
CODEQL_ACTION_RECONCILE_GO_EXTRACTION: 'true'
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

100
.github/workflows/__go-tracing-autobuilder.yml generated vendored Normal file
View File

@@ -0,0 +1,100 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: 'PR Check - Go: tracing with autobuilder step'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
go-tracing-autobuilder:
strategy:
matrix:
include:
- os: ubuntu-latest
version: stable-20220401
- os: macos-latest
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: 'Go: tracing with autobuilder step'
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/autobuild
- uses: ./../action/analyze
with:
upload-database: false
- shell: bash
run: |
if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then
echo "Expected the Go autobuilder to be run, but the" \
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was not true."
exit 1
fi
cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d go ]]; then
echo "Did not find a Go database"
exit 1
fi
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
CODEQL_ACTION_TEST_MODE: true

104
.github/workflows/__go-tracing-custom-build-steps.yml generated vendored Normal file
View File

@@ -0,0 +1,104 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: 'PR Check - Go: tracing with custom build steps'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
go-tracing-custom-build-steps:
strategy:
matrix:
include:
- os: ubuntu-latest
version: stable-20220401
- os: macos-latest
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: 'Go: tracing with custom build steps'
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code
shell: bash
run: go build main.go
- uses: ./../action/analyze
with:
upload-database: false
- shell: bash
run: |
# Once we start running Bash 4.2 in all environments, we can replace the
# `! -z` flag with the more elegant `-v` which confirms that the variable
# is actually unset and not potentially set to a blank value.
if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then
echo "Expected the Go autobuilder not to be run, but the" \
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
exit 1
fi
cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d go ]]; then
echo "Did not find a Go database"
exit 1
fi
env:
CODEQL_ACTION_TEST_MODE: true

94
.github/workflows/__go-tracing-legacy-workflow.yml generated vendored Normal file
View File

@@ -0,0 +1,94 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: 'PR Check - Go: tracing with legacy workflow'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
go-tracing-legacy-workflow:
strategy:
matrix:
include:
- os: ubuntu-latest
version: stable-20220401
- os: macos-latest
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: 'Go: tracing with legacy workflow'
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:
upload-database: false
- shell: bash
run: |
cd "$RUNNER_TEMP/codeql_databases"
if [[ ! -d go ]]; then
echo "Did not find a Go database"
exit 1
fi
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Download using registries'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -25,6 +25,18 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: windows-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: windows-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
@@ -39,9 +51,20 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Init with registries
uses: ./../action/init
with:
@@ -54,13 +77,11 @@ jobs:
packages: "*/*"
token: "${{ secrets.GITHUB_TOKEN }}"
env:
TEST_MODE: true
- name: Verify packages installed
shell: bash
run: |
PRIVATE_PACK="$HOME/.codeql/packages/dsp-testing/private-pack"
CODEQL_PACK1="$HOME/.codeql/packages/dsp-testing/codeql-pack1"
PRIVATE_PACK="$HOME/.codeql/packages/codeql-testing/private-pack"
CODEQL_PACK1="$HOME/.codeql/packages/codeql-testing/codeql-pack1"
if [[ -d $PRIVATE_PACK ]]
then
@@ -77,5 +98,39 @@ jobs:
echo "::error $CODEQL_PACK1 pack was not installed."
exit 1
fi
- name: Verify qlconfig.yml file was created
shell: bash
run: |
QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH"
if [[ -f $QLCONFIG_PATH ]]
then
echo "qlconfig.yml file was created."
else
echo "::error qlconfig.yml file was not created."
exit 1
fi
- name: Verify contents of qlconfig.yml
# yq is not available on windows
if: runner.os != 'Windows'
shell: bash
run: |
QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml
cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")'
if [[ $? -eq 0 ]]
then
echo "Registry was added to qlconfig.yml file."
else
echo "::error Registry was not added to qlconfig.yml file."
echo "Contents of qlconfig.yml file:"
cat $QLCONFIG_PATH
exit 1
fi
permissions:
contents: read
packages: read
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - Custom source root
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -39,9 +39,20 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Move codeql-action
shell: bash
run: |
@@ -52,12 +63,11 @@ jobs:
languages: javascript
source-root: ../new-source-root
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/analyze
with:
upload-database: false
skip-queries: true
upload: false
upload: never
- name: Assert database exists
shell: bash
run: |
@@ -67,4 +77,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - ML-powered queries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -26,11 +26,29 @@ jobs:
matrix:
include:
- os: ubuntu-latest
version: stable-20220120
version: stable-20220401
- os: macos-latest
version: stable-20220120
version: stable-20220401
- os: windows-latest
version: stable-20220120
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20220615
- os: windows-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20220908
- os: windows-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: windows-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
@@ -57,24 +75,31 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: javascript
queries: security-extended
source-root: ./../action/tests/ml-powered-queries-repo
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
env:
TEST_MODE: true
- name: Upload SARIF
uses: actions/upload-artifact@v3
@@ -84,25 +109,20 @@ jobs:
retention-days: 7
- name: Check sarif
uses: ./../action/.github/check-sarif
if: matrix.os != 'windows-latest' || matrix.version == 'latest' || matrix.version
== 'nightly-latest'
uses: ./../action/.github/actions/check-sarif
# Running on Windows requires CodeQL CLI 2.9.0+.
if: "!(matrix.version == 'stable-20220401' && runner.os == 'Windows')"
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/ml-powered/nosql-injection,js/ml-powered/path-injection,js/ml-powered/sql-injection,js/ml-powered/xss
queries-run:
js/ml-powered/nosql-injection,js/ml-powered/path-injection,js/ml-powered/sql-injection,js/ml-powered/xss
queries-not-run: foo,bar
- name: Check results
# Running ML-powered queries on Windows requires CodeQL CLI 2.9.0+. We don't run these checks
# against Windows and `cached` while CodeQL CLI 2.9.0 makes its way into `cached` to avoid the
# test starting to fail when the cached CodeQL Bundle gets updated. Once the CodeQL Bundle
# containing CodeQL CLI 2.9.0 has been fully released, we can drop this line and start running
# these checks on Windows and `cached`.
if: matrix.os != 'windows-latest' || matrix.version != 'cached'
env:
# Running on Windows requires CodeQL CLI 2.9.0+, which has so far only made it to 'latest'.
SHOULD_RUN_ML_POWERED_QUERIES: ${{ matrix.os != 'windows-latest' || matrix.version
== 'latest' || matrix.version == 'nightly-latest' }}
# Running on Windows requires CodeQL CLI 2.9.0+.
SHOULD_RUN_ML_POWERED_QUERIES: ${{ !(matrix.version == 'stable-20220401' &&
runner.os == 'Windows') }}
shell: bash
run: |
echo "Expecting ML-powered queries to be run: ${SHOULD_RUN_ML_POWERED_QUERIES}"
@@ -137,4 +157,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - Multi-language repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -25,18 +25,22 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: ubuntu-latest
version: stable-20220401
- os: macos-latest
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20210809
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
@@ -57,23 +61,41 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
id: init
with:
db-location: ${{ runner.temp }}/customDbLocation
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
id: analysis
env:
TEST_MODE: true
- shell: bash
with:
upload-database: false
- name: Check language autodetect for all languages excluding Ruby, Swift
shell: bash
run: |
CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }}
if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
@@ -105,5 +127,25 @@ jobs:
echo "Did not create a database for Python, or created it in the wrong location."
exit 1
fi
- name: Check language autodetect for Ruby
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true'
shell: bash
run: |
RUBY_DB=${{ fromJson(steps.analysis.outputs.db-locations).ruby }}
if [[ ! -d $RUBY_DB ]] || [[ ! $RUBY_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
echo "Did not create a database for Ruby, or created it in the wrong location."
exit 1
fi
- name: Check language autodetect for Swift
if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true'
shell: bash
run: |
SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }}
if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then
echo "Did not create a database for Swift, or created it in the wrong location."
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Config and input passed to the CLI'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -51,31 +51,40 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
config-file: .github/codeql/codeql-config-packaging3.yml
packs: +dsp-testing/codeql-pack1@1.0.0
packs: +codeql-testing/codeql-pack1@1.0.0
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
env:
TEST_MODE: true
upload-database: false
- name: Check results
uses: ./../action/.github/check-sarif
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
queries-run:
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
queries-not-run: foo,bar
- name: Assert Results
@@ -95,4 +104,4 @@ jobs:
env:
CODEQL_PASS_CONFIG_TO_CLI: true
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Config and input'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -51,31 +51,40 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
config-file: .github/codeql/codeql-config-packaging3.yml
packs: +dsp-testing/codeql-pack1@1.0.0
packs: +codeql-testing/codeql-pack1@1.0.0
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
env:
TEST_MODE: true
upload-database: false
- name: Check results
uses: ./../action/.github/check-sarif
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
queries-run:
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
queries-not-run: foo,bar
- name: Assert Results
@@ -93,4 +102,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Config file'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -51,30 +51,39 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
config-file: .github/codeql/codeql-config-packaging.yml
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
env:
TEST_MODE: true
upload-database: false
- name: Check results
uses: ./../action/.github/check-sarif
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
queries-run:
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
queries-not-run: foo,bar
- name: Assert Results
@@ -92,4 +101,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: 'PR Check - Packaging: Action input'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -51,31 +51,39 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
config-file: .github/codeql/codeql-config-packaging2.yml
languages: javascript
packs: dsp-testing/codeql-pack1@1.0.0, dsp-testing/codeql-pack2, dsp-testing/codeql-pack3:other-query.ql
packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2, codeql-testing/codeql-pack3:other-query.ql
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
env:
TEST_MODE: true
- name: Check results
uses: ./../action/.github/check-sarif
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
queries-run:
javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block
queries-not-run: foo,bar
- name: Assert Results
@@ -93,4 +101,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - Remote config file
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -25,24 +25,30 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: ubuntu-latest
version: stable-20220401
- os: macos-latest
version: stable-20210308
- os: windows-2019
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
version: stable-20220401
- os: windows-latest
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20210319
- os: windows-2019
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
version: stable-20220615
- os: windows-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20210809
- os: windows-2019
version: stable-20210809
version: stable-20220908
- os: windows-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: windows-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
@@ -69,22 +75,29 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: cpp,csharp,java,javascript,python
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
github.sha }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
env:
TEST_MODE: true
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - RuboCop multi-language
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -35,9 +35,20 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
@@ -58,7 +69,5 @@ jobs:
- uses: ./../action/upload-sarif
with:
sarif_file: rubocop.sarif
env:
TEST_MODE: true
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

79
.github/workflows/__ruby.yml generated vendored Normal file
View File

@@ -0,0 +1,79 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: PR Check - Ruby analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
ruby:
strategy:
matrix:
include:
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: Ruby analysis
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: ruby
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
id: analysis
with:
upload-database: false
- name: Check database
shell: bash
run: |
RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}"
if [[ ! -d "$RUBY_DB" ]]; then
echo "Did not create a database for Ruby."
exit 1
fi
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - Split workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -45,17 +45,26 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
config-file: .github/codeql/codeql-config-packaging3.yml
packs: +dsp-testing/codeql-pack1@1.0.0
packs: +codeql-testing/codeql-pack1@1.0.0
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
@@ -63,8 +72,7 @@ jobs:
with:
skip-queries: true
output: ${{ runner.temp }}/results
env:
TEST_MODE: true
upload-database: false
- name: Assert No Results
shell: bash
@@ -77,8 +85,6 @@ jobs:
with:
output: ${{ runner.temp }}/results
upload-database: false
env:
TEST_MODE: true
- name: Assert Results
shell: bash
run: |
@@ -94,4 +100,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

83
.github/workflows/__submit-sarif-failure.yml generated vendored Normal file
View File

@@ -0,0 +1,83 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: PR Check - Submit SARIF after failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
submit-sarif-failure:
strategy:
matrix:
include:
- os: ubuntu-latest
version: latest
- os: ubuntu-latest
version: cached
- os: ubuntu-latest
version: nightly-latest
name: Submit SARIF after failure
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: ./init
with:
languages: javascript
- name: Fail
# We want this job to pass if the Action correctly uploads the SARIF file for
# the failed run.
# Setting this step to continue on error means that it is marked as completing
# successfully, so will not fail the job.
continue-on-error: true
run: exit 1
- uses: ./analyze
# In a real workflow, this step wouldn't run. Since we used `continue-on-error`
# above, we manually disable it with an `if` condition.
if: false
with:
category: /test-codeql-version:${{ matrix.version }}
env:
# Internal-only environment variable used to indicate that the post-init Action
# should expect to upload a SARIF file for the failed run.
CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF: true
# Make sure the uploading SARIF files feature is enabled.
CODEQL_ACTION_UPLOAD_FAILED_SARIF: true
# Upload the failed SARIF file as an integration test of the API endpoint.
CODEQL_ACTION_TEST_MODE: false
# Mark telemetry for this workflow so it can be treated separately.
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks

90
.github/workflows/__swift-custom-build.yml generated vendored Normal file
View File

@@ -0,0 +1,90 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: PR Check - Swift analysis using a custom build command
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
swift-custom-build:
strategy:
matrix:
include:
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: Swift analysis using a custom build command
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
id: init
with:
languages: swift
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{steps.init.outputs.codeql-path}}
- name: Check working directory
shell: bash
run: pwd
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
id: analysis
with:
upload-database: false
- name: Check database
shell: bash
run: |
SWIFT_DB="${{ fromJson(steps.analysis.outputs.db-locations).swift }}"
if [[ ! -d "$SWIFT_DB" ]]; then
echo "Did not create a database for Swift."
exit 1
fi
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false'
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - Autobuild working directory
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -35,9 +35,20 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Test setup
shell: bash
run: |
@@ -49,14 +60,12 @@ jobs:
with:
languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/autobuild
with:
working-directory: autobuild-dir
- uses: ./../action/analyze
env:
TEST_MODE: true
with:
upload-database: false
- name: Check database
shell: bash
run: |
@@ -66,4 +75,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - Local CodeQL bundle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -35,25 +35,38 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- name: Fetch a CodeQL bundle
shell: bash
env:
CODEQL_URL: ${{ steps.prepare-test.outputs.tools-url }}
run: |
wget "$CODEQL_URL"
- uses: ./../action/init
- id: init
uses: ./../action/init
with:
tools: ./codeql-bundle.tar.gz
env:
TEST_MODE: true
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
env:
TEST_MODE: true
with:
upload-database: false
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

23
.github/workflows/__test-proxy.yml generated vendored
View File

@@ -7,11 +7,11 @@ name: PR Check - Proxy test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -35,21 +35,30 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/analyze
env:
TEST_MODE: true
with:
upload-database: false
env:
https_proxy: http://squid-proxy:3128
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true
container:
image: ubuntu:22.04
options: --dns 127.0.0.1

71
.github/workflows/__test-ruby.yml generated vendored
View File

@@ -1,71 +0,0 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: PR Check - Ruby analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
test-ruby:
strategy:
matrix:
include:
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
name: Ruby analysis
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
with:
version: ${{ matrix.version }}
- uses: ./../action/init
with:
languages: ruby
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/analyze
id: analysis
env:
TEST_MODE: true
- name: Check database
shell: bash
run: |
RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}"
if [[ ! -d "$RUBY_DB" ]]; then
echo "Did not create a database for Ruby."
exit 1
fi
env:
CODEQL_ENABLE_EXPERIMENTAL_FEATURES: 'true'
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

121
.github/workflows/__unset-environment.yml generated vendored Normal file
View File

@@ -0,0 +1,121 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pip install ruamel.yaml && python3 sync.py
# to regenerate this file.
name: PR Check - Test unsetting environment variables
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
unset-environment:
strategy:
matrix:
include:
- os: ubuntu-latest
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: ubuntu-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
name: Test unsetting environment variables
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
id: init
with:
db-location: ${{ runner.temp }}/customDbLocation
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code
shell: bash
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
# workaround for our PR checks.
run: env -i CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN=true PATH="$PATH" HOME="$HOME"
./build.sh
- uses: ./../action/analyze
id: analysis
with:
upload-database: false
- shell: bash
run: |
CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
if [[ ! -d "$CPP_DB" ]] || [[ ! "$CPP_DB" == "${RUNNER_TEMP}/customDbLocation/cpp" ]]; then
echo "::error::Did not create a database for CPP, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/cpp' but actual was '${CPP_DB}'"
exit 1
fi
CSHARP_DB="${{ fromJson(steps.analysis.outputs.db-locations).csharp }}"
if [[ ! -d "$CSHARP_DB" ]] || [[ ! "$CSHARP_DB" == "${RUNNER_TEMP}/customDbLocation/csharp" ]]; then
echo "::error::Did not create a database for C Sharp, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/csharp' but actual was '${CSHARP_DB}'"
exit 1
fi
GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}"
if [[ ! -d "$GO_DB" ]] || [[ ! "$GO_DB" == "${RUNNER_TEMP}/customDbLocation/go" ]]; then
echo "::error::Did not create a database for Go, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/go' but actual was '${GO_DB}'"
exit 1
fi
JAVA_DB="${{ fromJson(steps.analysis.outputs.db-locations).java }}"
if [[ ! -d "$JAVA_DB" ]] || [[ ! "$JAVA_DB" == "${RUNNER_TEMP}/customDbLocation/java" ]]; then
echo "::error::Did not create a database for Java, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/java' but actual was '${JAVA_DB}'"
exit 1
fi
JAVASCRIPT_DB="${{ fromJson(steps.analysis.outputs.db-locations).javascript }}"
if [[ ! -d "$JAVASCRIPT_DB" ]] || [[ ! "$JAVASCRIPT_DB" == "${RUNNER_TEMP}/customDbLocation/javascript" ]]; then
echo "::error::Did not create a database for Javascript, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/javascript' but actual was '${JAVASCRIPT_DB}'"
exit 1
fi
PYTHON_DB="${{ fromJson(steps.analysis.outputs.db-locations).python }}"
if [[ ! -d "$PYTHON_DB" ]] || [[ ! "$PYTHON_DB" == "${RUNNER_TEMP}/customDbLocation/python" ]]; then
echo "::error::Did not create a database for Python, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/python' but actual was '${PYTHON_DB}'"
exit 1
fi
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: "PR Check - Upload-sarif: 'ref' and 'sha' from inputs"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -25,24 +25,30 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: ubuntu-latest
version: stable-20220401
- os: macos-latest
version: stable-20210308
- os: windows-2019
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
version: stable-20220401
- os: windows-latest
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20210319
- os: windows-2019
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
version: stable-20220615
- os: windows-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20210809
- os: windows-2019
version: stable-20210809
version: stable-20220908
- os: windows-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: windows-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
@@ -69,32 +75,38 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: cpp,csharp,java,javascript,python
config-file: ${{ github.repository }}/tests/multi-language-repo/.github/codeql/custom-queries.yml@${{
github.sha }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
upload: false
env:
TEST_MODE: true
upload: never
- uses: ./../action/upload-sarif
with:
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
env:
TEST_MODE: true
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -7,11 +7,11 @@ name: PR Check - Use a custom `checkout_path`
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -25,24 +25,30 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: ubuntu-latest
version: stable-20220401
- os: macos-latest
version: stable-20210308
- os: windows-2019
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
version: stable-20220401
- os: windows-latest
version: stable-20220401
- os: ubuntu-latest
version: stable-20220615
- os: macos-latest
version: stable-20210319
- os: windows-2019
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
version: stable-20220615
- os: windows-latest
version: stable-20220615
- os: ubuntu-latest
version: stable-20220908
- os: macos-latest
version: stable-20210809
- os: windows-2019
version: stable-20210809
version: stable-20220908
- os: windows-latest
version: stable-20220908
- os: ubuntu-latest
version: stable-20221211
- os: macos-latest
version: stable-20221211
- os: windows-latest
version: stable-20221211
- os: ubuntu-latest
version: cached
- os: macos-latest
@@ -69,9 +75,20 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211' ||
matrix.version == 'cached' ||
matrix.version == 'latest' ||
matrix.version == 'nightly-latest'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
@@ -83,8 +100,6 @@ jobs:
languages: csharp,javascript
source-path: x/y/z/some-path/tests/multi-language-repo
debug: true
env:
TEST_MODE: true
- name: Build code (non-windows)
shell: bash
if: ${{ runner.os != 'Windows' }}
@@ -100,17 +115,14 @@ jobs:
checkout_path: x/y/z/some-path/tests/multi-language-repo
ref: v1.1.0
sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
upload: false
env:
TEST_MODE: true
upload: never
upload-database: false
- uses: ./../action/upload-sarif
with:
ref: v1.1.0
sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6
checkout_path: x/y/z/some-path/tests/multi-language-repo
env:
TEST_MODE: true
- name: Verify SARIF after upload
shell: bash
@@ -141,4 +153,4 @@ jobs:
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -2,12 +2,18 @@ name: "CodeQL action"
on:
push:
branches: [main, releases/v1, releases/v2]
branches: [main, releases/v2]
pull_request:
branches: [main, releases/v1, releases/v2]
branches: [main, releases/v2]
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
# by other workflows.
types: [opened, synchronize, reopened, ready_for_review]
schedule:
# Weekly on Sunday.
- cron: '30 1 * * 0'
env:
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
jobs:
# Identify the CodeQL tool versions to use in the analysis job.
@@ -51,7 +57,7 @@ jobs:
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
# required status check.
#
# If we're running on push, then we can skip running with `tools: latest` when it would be
# If we're running on push or schedule, then we can skip running with `tools: latest` when it would be
# the same as running with `tools: null`.
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
VERSIONS_JSON='[null]'
@@ -75,8 +81,10 @@ jobs:
security-events: write
steps:
- uses: actions/checkout@v3
- uses: ./init
- name: Checkout
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: ./init
id: init
with:
languages: javascript
@@ -85,4 +93,5 @@ jobs:
# confirm steps.init.outputs.codeql-path points to the codeql binary
- name: Print CodeQL Version
run: ${{steps.init.outputs.codeql-path}} version --format=json
- uses: ./analyze
- name: Perform CodeQL Analysis
uses: ./analyze

View File

@@ -9,7 +9,6 @@ on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -48,12 +47,12 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Empty file
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: "{}"
languages: javascript
@@ -61,31 +60,31 @@ jobs:
- name: Packs from input
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": ["dsp-testing/codeql-pack1@1.0.0", "dsp-testing/codeql-pack2" ]
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
languages: javascript
packs: dsp-testing/codeql-pack1@1.0.0, dsp-testing/codeql-pack2
packs: codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Packs from input with +
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": ["dsp-testing/codeql-pack1@1.0.0", "dsp-testing/codeql-pack2" ]
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
languages: javascript
packs: + dsp-testing/codeql-pack1@1.0.0, dsp-testing/codeql-pack2
packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries from input
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
@@ -97,7 +96,7 @@ jobs:
- name: Queries from input with +
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
@@ -109,27 +108,27 @@ jobs:
- name: Queries and packs from input with +
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }],
"packs": ["dsp-testing/codeql-pack1@1.0.0", "dsp-testing/codeql-pack2" ]
"packs": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
languages: javascript
queries: + ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql
packs: + dsp-testing/codeql-pack1@1.0.0, dsp-testing/codeql-pack2
packs: + codeql-testing/codeql-pack1@1.0.0, codeql-testing/codeql-pack2
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Queries and packs from config
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"queries": [{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql" }],
"packs": {
"javascript": ["dsp-testing/codeql-pack1@1.0.0", "dsp-testing/codeql-pack2" ]
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ]
}
}
languages: javascript
@@ -138,7 +137,7 @@ jobs:
- name: Queries and packs from config overriden by input
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
@@ -153,7 +152,7 @@ jobs:
- name: Queries and packs from config merging with input
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
@@ -162,7 +161,7 @@ jobs:
{ "uses": "./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql" }
],
"packs": {
"javascript": ["dsp-testing/codeql-pack1@1.0.0", "dsp-testing/codeql-pack2", "codeql/javascript-queries" ]
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2", "codeql/javascript-queries" ]
}
}
languages: javascript
@@ -173,12 +172,12 @@ jobs:
- name: Multi-language packs from config
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
"packs": {
"javascript": ["dsp-testing/codeql-pack1@1.0.0", "dsp-testing/codeql-pack2" ],
"javascript": ["codeql-testing/codeql-pack1@1.0.0", "codeql-testing/codeql-pack2" ],
"ruby": ["codeql/ruby-queries"]
},
"queries": [
@@ -191,7 +190,7 @@ jobs:
- name: Other config properties
if: success() || failure()
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: |
{
@@ -210,7 +209,7 @@ jobs:
if: success() || failure()
env:
CODEQL_PASS_CONFIG_TO_CLI: false
uses: ./../action/.github/check-codescanning-config
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: ""
languages: javascript

View File

@@ -2,12 +2,14 @@
# when the analyze step fails.
name: PR Check - Debug artifacts after failure
env:
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
# workaround for our PR checks.
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -23,6 +25,8 @@ jobs:
os: [ubuntu-latest, macos-latest]
name: Upload debug artifacts after failure in analyze
continue-on-error: true
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
@@ -32,17 +36,18 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: latest
- uses: actions/setup-go@v4
with:
go-version: ^1.13.1
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
debug: true
debug-artifact-name: my-debug-artifacts
debug-database-name: my-db
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
@@ -51,8 +56,6 @@ jobs:
with:
expect-error: true
ram: 1
env:
TEST_MODE: true
download-and-check-artifacts:
name: Download and check debug artifacts after failure in analyze
needs: upload-artifacts
@@ -87,4 +90,4 @@ jobs:
popd
done
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
GO111MODULE: auto

View File

@@ -1,12 +1,14 @@
# Checks logs, SARIF, and database bundle debug artifacts exist.
name: PR Check - Debug artifact upload
env:
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
# workaround for our PR checks.
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -19,32 +21,20 @@ jobs:
upload-artifacts:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: macos-latest
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
- os: macos-latest
version: stable-20210319
- os: ubuntu-20.04
version: stable-20210809
- os: macos-latest
version: stable-20210809
- os: ubuntu-latest
version: cached
- os: macos-latest
version: cached
- os: ubuntu-latest
version: latest
- os: macos-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
version: nightly-latest
os:
- ubuntu-latest
- macos-latest
version:
- stable-20220401
- stable-20220615
- stable-20220908
- stable-20221211
- cached
- latest
- nightly-latest
name: Upload debug artifacts
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
@@ -52,24 +42,23 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@v4
with:
go-version: ^1.13.1
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
debug: true
debug-artifact-name: my-debug-artifacts
debug-database-name: my-db
env:
TEST_MODE: true
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
id: analysis
env:
TEST_MODE: true
download-and-check-artifacts:
name: Download and check debug artifacts
needs: upload-artifacts
@@ -81,17 +70,10 @@ jobs:
- name: Check expected artifacts exist
shell: bash
run: |
VERSIONS="stable-20210308 stable-20210319 stable-20210809 cached latest nightly-latest"
VERSIONS="stable-20220401 stable-20220615 stable-20220908 stable-20221211 cached latest nightly-latest"
LANGUAGES="cpp csharp go java javascript python"
for version in $VERSIONS; do
if [[ "$version" =~ stable-(20210308|20210319|20210809) ]]; then
# Note the absence of the period in "ubuntu-2004": this is present in the image name
# but not the artifact name
OPERATING_SYSTEMS="ubuntu-2004 macos-latest"
else
OPERATING_SYSTEMS="ubuntu-latest macos-latest"
fi
for os in $OPERATING_SYSTEMS; do
for os in ubuntu-latest macos-latest; do
pushd "./my-debug-artifacts-$os-$version"
echo "Artifacts from version $version on $os:"
for language in $LANGUAGES; do
@@ -113,4 +95,4 @@ jobs:
done
done
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
GO111MODULE: auto

View File

@@ -4,7 +4,6 @@ on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -17,6 +16,8 @@ on:
jobs:
expected-queries:
name: Expected Queries Tests
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
@@ -24,25 +25,21 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: latest
- uses: ./../action/init
with:
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
upload: false
env:
TEST_MODE: true
upload: never
- name: Check Sarif
uses: ./../action/.github/check-sarif
uses: ./../action/.github/actions/check-sarif
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/incomplete-hostname-regexp,js/path-injection

View File

@@ -1,8 +1,9 @@
# This workflow runs after a release of the action. For v2 releases, it merges any changes from the
# release back into the main branch. Typically, this is just a single commit that updates the
# changelog. For v2 and v1 releases, it then (a) tags the merge commit on the release branch that
# represents the new release with an `vx.y.z` tag and (b) updates the `vx` tag to refer to this
# commit.
# This workflow runs after a release of the action. It:
# 1. Merges any changes from the release back into the main branch. Typically, this is just a single
# commit that updates the changelog.
# 2. Tags the merge commit on the release branch that represents the new release with an `v2.x.y`
# tag
# 3. Updates the `v2` tag to refer to this merge commit.
name: Tag release and merge back
on:
@@ -15,7 +16,6 @@ on:
push:
branches:
- releases/v1
- releases/v2
jobs:
@@ -105,7 +105,7 @@ jobs:
git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}"
- name: Create mergeback branch
if: steps.check.outputs.exists != 'true' && contains(github.ref, 'releases/v2')
if: steps.check.outputs.exists != 'true'
env:
VERSION: "${{ steps.getVersion.outputs.version }}"
NEW_BRANCH: "${{ steps.getVersion.outputs.newBranch }}"

View File

@@ -2,7 +2,7 @@ name: PR Checks
on:
push:
branches: [main, releases/v1, releases/v2]
branches: [main, releases/v2]
pull_request:
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
# by other workflows.
@@ -15,10 +15,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
matrix:
node-types-version: [12.12, current]
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -26,28 +22,6 @@ jobs:
- name: Lint
run: npm run-script lint
- name: Update version of @types/node
if: matrix.node-types-version != 'current'
env:
NODE_TYPES_VERSION: ${{ matrix.node-types-version }}
run: |
# Export `NODE_TYPES_VERSION` so it's available to jq
export NODE_TYPES_VERSION="${NODE_TYPES_VERSION}"
contents=$(jq '.devDependencies."@types/node" = env.NODE_TYPES_VERSION' package.json)
echo "${contents}" > package.json
# Usually we run `npm install` on macOS to ensure that we pick up macOS-only dependencies.
# However we're not checking in the updated lockfile here, so it's fine to run
# `npm install` on Linux.
npm install
if [ ! -z "$(git status --porcelain)" ]; then
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions[bot]"
# The period in `git add --all .` ensures that we stage deleted files too.
git add --all .
git commit -m "Use @types/node=${NODE_TYPES_VERSION}"
fi
- name: Check generated JS
run: .github/workflows/script/check-js.sh
@@ -70,25 +44,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
# Checks for any conflict markers created by git. This check is primarily intended to validate that
# any merge conflicts in the v2 -> v1 backport PR are fixed before the PR is merged.
- name: Check for merge conflicts
run: |
# Use `|| true` since grep returns exit code 1 if there are no matches, and we don't want
# this to fail the workflow.
FILES_WITH_CONFLICTS=$(grep --extended-regexp --ignore-case --line-number --recursive \
'^(<<<<<<<|>>>>>>>)' . || true)
if [[ "${FILES_WITH_CONFLICTS}" ]]; then
echo "Fail: Found merge conflict markers in the following files:"
echo ""
echo "${FILES_WITH_CONFLICTS}"
exit 1
else
echo "Success: Found no merge conflict markers."
fi
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8

View File

@@ -1,8 +1,8 @@
name: Test Python Package Installation on Linux and Mac
name: Test Python Package Installation
on:
push:
branches: [main, releases/v1, releases/v2]
branches: [main, releases/v2]
pull_request:
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
# by other workflows.
@@ -28,17 +28,7 @@ jobs:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest]
python_deps_type: [pipenv, poetry, requirements, setup_py]
python_version: [2, 3]
exclude:
# Python2 and poetry are not supported. See https://github.com/actions/setup-python/issues/374
- python_version: 2
python_deps_type: poetry
# Python2 and pipenv are not supported since pipenv v2021.11.5
- python_version: 2
python_deps_type: pipenv
# Python2 is not available on ubuntu-22.04 by default -- see https://github.com/github/codeql-action/pull/1257
- python_version: 2
os: ubuntu-22.04
python_version: [3]
env:
@@ -138,16 +128,10 @@ jobs:
fail-fast: false
matrix:
python_deps_type: [pipenv, poetry, requirements, setup_py]
python_version: [2, 3]
exclude:
# Python2 and poetry are not supported. See https://github.com/actions/setup-python/issues/374
- python_version: 2
python_deps_type: poetry
# Python2 and pipenv are not supported since pipenv v2021.11.5
- python_version: 2
python_deps_type: pipenv
python_version: [3]
env:
CODEQL_ACTION_TEST_MODE: true
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
PYTHON_VERSION: ${{ matrix.python_version }}
@@ -155,29 +139,28 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Initialize CodeQL
id: init
uses: ./init
with:
tools: latest
languages: python
setup-python-dependencies: false
env:
TEST_MODE: true
- name: Test Auto Package Installation
env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
run: |
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
powershell -File $cmd
cd $Env:GITHUB_WORKSPACE\\python-setup/tests/$Env:PYTHON_DEPS_TYPE/requests-$Env:PYTHON_VERSION
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\$CodeQLVersion\\x64\\codeql
$codeql_dist = (get-item $Env:CODEQL_PATH).Directory.FullName
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py $codeql_dist
- name: Setup for extractor
run: |

View File

@@ -4,7 +4,6 @@ on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
@@ -24,12 +23,12 @@ jobs:
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
uses: ./.github/actions/prepare-test
with:
version: latest
- name: Check SARIF for default queries with Single include, Single exclude
uses: ./../action/.github/query-filter-test
uses: ./../action/.github/actions/query-filter-test
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/zipslip
@@ -38,7 +37,7 @@ jobs:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check SARIF for query packs with Single include, Single exclude
uses: ./../action/.github/query-filter-test
uses: ./../action/.github/actions/query-filter-test
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/zipslip,javascript/example/empty-or-one-block
@@ -47,7 +46,7 @@ jobs:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check SARIF for query packs and local queries with Single include, Single exclude
uses: ./../action/.github/query-filter-test
uses: ./../action/.github/actions/query-filter-test
with:
sarif-file: ${{ runner.temp }}/results/javascript.sarif
queries-run: js/zipslip,javascript/example/empty-or-one-block,inrepo-javascript-querypack/show-ifs

View File

@@ -1,412 +0,0 @@
name: CodeQL Runner Checks
on:
push:
branches: [main, releases/v1, releases/v2]
pull_request:
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
# by other workflows.
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
jobs:
runner-analyze-javascript-ubuntu:
name: Runner ubuntu JS analyze
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build runner
run: |
cd runner
npm install
npm run build-runner
- name: Run init
run: |
# Pass --config-file here, but not for other jobs in this workflow.
# This means we're testing the config file parsing in the runner
# but not slowing down all jobs unnecessarily as it doesn't add much
# testing the parsing on different operating systems and languages.
runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages javascript --config-file ./.github/codeql/codeql-config.yml --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Run analyze
run: |
runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
runner-analyze-javascript-windows:
name: Runner windows JS analyze
timeout-minutes: 45
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Build runner
run: |
cd runner
npm install
npm run build-runner
- name: Run init
run: |
runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages javascript --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Run analyze
run: |
runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
runner-analyze-javascript-macos:
name: Runner macos JS analyze
timeout-minutes: 45
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build runner
run: |
cd runner
npm install
npm run build-runner
- name: Run init
run: |
runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages javascript --config-file ./.github/codeql/codeql-config.yml --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Run analyze
run: |
runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
runner-analyze-csharp-ubuntu:
name: Runner ubuntu C# analyze
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner
- name: Run init
run: |
../action/runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Build code
run: |
. ./codeql-runner/codeql-env.sh
$CODEQL_RUNNER dotnet build /p:UseSharedCompilation=false
- name: Run analyze
run: |
../action/runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
runner-analyze-csharp-windows:
name: Runner windows C# analyze
# Build tracing currently does not support Windows 2022, so use `windows-2019` instead of
# `windows-latest`.
timeout-minutes: 45
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner
- name: Run init
run: |
../action/runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages csharp --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Build code
shell: powershell
run: |
cat ./codeql-runner/codeql-env.sh | Invoke-Expression
& $Env:CODEQL_RUNNER dotnet build /p:UseSharedCompilation=false
- name: Upload tracer logs
uses: actions/upload-artifact@v3
with:
name: tracer-logs
path: ./codeql-runner/compound-build-tracer.log
- name: Run analyze
run: |
../action/runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
runner-analyze-csharp-macos:
name: Runner macos C# analyze
timeout-minutes: 45
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner
- name: Run init
run: |
../action/runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: |
. ./codeql-runner/codeql-env.sh
$CODEQL_RUNNER dotnet build /p:UseSharedCompilation=false
- name: Run analyze
run: |
../action/runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
runner-analyze-csharp-autobuild-ubuntu:
name: Runner ubuntu autobuild C# analyze
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner
- name: Run init
run: |
../action/runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Build code
run: |
../action/runner/dist/codeql-runner-linux autobuild
- name: Run analyze
run: |
../action/runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
runner-analyze-csharp-autobuild-windows:
timeout-minutes: 45
name: Runner windows autobuild C# analyze
# Build tracing currently does not support Windows 2022, so use `windows-2019` instead of
# `windows-latest`.
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner
- name: Run init
run: |
../action/runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages csharp --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Build code
shell: powershell
run: |
../action/runner/dist/codeql-runner-win.exe autobuild
- name: Run analyze
run: |
../action/runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
runner-analyze-csharp-autobuild-macos:
name: Runner macos autobuild C# analyze
runs-on: macos-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- name: Move codeql-action
shell: bash
run: |
mkdir ../action
mv * .github ../action/
mv ../action/tests/multi-language-repo/{*,.github} .
mv ../action/.github/workflows .github
- name: Build runner
run: |
cd ../action/runner
npm install
npm run build-runner
- name: Run init
run: |
../action/runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: |
. codeql-runner/codeql-env.sh
CODEQL_RUNNER="$(cat codeql-runner/codeql-env.json | jq -r '.CODEQL_RUNNER')"
echo "$CODEQL_RUNNER"
$CODEQL_RUNNER ../action/runner/dist/codeql-runner-macos autobuild
- name: Run analyze
run: |
../action/runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
runner-upload-sarif:
name: Runner upload sarif
runs-on: ubuntu-latest
timeout-minutes: 45
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id }}
steps:
- uses: actions/checkout@v3
- name: Build runner
run: |
cd runner
npm install
npm run build-runner
- name: Upload with runner
run: |
# Deliberately don't use TEST_MODE here. This is specifically testing
# the compatibility with the API.
runner/dist/codeql-runner-linux upload --sarif-file src/testdata/empty-sarif.sarif --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
runner-extractor-ram-threads-options:
name: Runner ubuntu extractor RAM and threads options
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- name: Build runner
run: |
cd runner
npm install
npm run build-runner
- name: Run init
run: |
runner/dist/codeql-runner-linux init --ram=230 --threads=1 --repository $GITHUB_REPOSITORY --languages java --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
env:
TEST_MODE: true
- name: Assert Results
shell: bash
run: |
. ./codeql-runner/codeql-env.sh
if [ "${CODEQL_RAM}" != "230" ]; then
echo "CODEQL_RAM is '${CODEQL_RAM}' instead of 230"
exit 1
fi
if [ "${CODEQL_EXTRACTOR_JAVA_RAM}" != "230" ]; then
echo "CODEQL_EXTRACTOR_JAVA_RAM is '${CODEQL_EXTRACTOR_JAVA_RAM}' instead of 230"
exit 1
fi
if [ "${CODEQL_THREADS}" != "1" ]; then
echo "CODEQL_THREADS is '${CODEQL_THREADS}' instead of 1"
exit 1
fi
if [ "${CODEQL_EXTRACTOR_JAVA_THREADS}" != "1" ]; then
echo "CODEQL_EXTRACTOR_JAVA_THREADS is '${CODEQL_EXTRACTOR_JAVA_THREADS}' instead of 1"
exit 1
fi

View File

@@ -7,16 +7,14 @@ if [ ! -z "$(git status --porcelain)" ]; then
>&2 echo "Failed: Repo should be clean before testing!"
exit 1
fi
sudo npm install --force -g npm@latest
# Reinstall modules and then clean to remove absolute paths
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible
npm ci
npm run removeNPMAbsolutePaths
"$(dirname "$0")/update-node-modules.sh" check-only
# Check that repo is still clean
if [ ! -z "$(git status --porcelain)" ]; then
# If we get a fail here then the PR needs attention
>&2 echo "Failed: node_modules are not up to date. Run 'npm ci && npm run removeNPMAbsolutePaths' on a macOS machine to update. Note it is important this command is run on macOS and not any other operating system as there is one dependency (fsevents) that is needed for macOS and may not be installed if the command is run on a Windows or Linux machine."
>&2 echo "Failed: node_modules are not up to date. Add the 'Update dependencies' label to your PR to update them. Note it is important that node modules are updated on macOS and not any other operating system as there is one dependency (fsevents) that is needed for macOS and may not be installed if dependencies are updated on a Windows or Linux machine."
git status
exit 1
fi
echo "Success: node_modules are up to date"
echo "Success: node_modules are up to date"

View File

@@ -0,0 +1,18 @@
if [ "$1" != "update" && "$1" != "check-only" ]; then
>&2 echo "Failed: Invalid argument. Must be 'update' or 'check-only'"
exit 1
fi
sudo npm install --force -g npm@9.2.0
# clean the npm cache to ensure we don't have any files owned by root
sudo npm cache clean --force
if [ "$1" = "update" ]; then
npm install
fi
# Reinstall modules and then clean to remove absolute paths
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible
npm ci
npm run removeNPMAbsolutePaths

View File

@@ -10,7 +10,7 @@ fi
if [ "$#" -eq 1 ]; then
# If we were passed an argument, use that as the SHA
GITHUB_SHA="$0"
GITHUB_SHA="$1"
elif [ "$#" -gt 1 ]; then
echo "Usage: $0 [SHA]"
echo "Update the required checks based on the SHA, or main."
@@ -23,13 +23,13 @@ fi
echo "Getting checks for $GITHUB_SHA"
# Ignore any checks with "https://", CodeQL, LGTM, and Update checks.
CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs | .[].name | select(contains("https://") or . == "CodeQL" or . == "LGTM.com" or contains("Update") or contains("update") or contains("test-setup-python-scripts") | not)] | unique | sort')"
CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs | .[].name | select(contains("https://") or . == "CodeQL" or . == "LGTM.com" or . == "check-expected-release-files" or contains("Update") or contains("update") or contains("test-setup-python-scripts") | not)] | unique | sort')"
echo "$CHECKS" | jq
echo "{\"contexts\": ${CHECKS}}" > checks.json
for BRANCH in main releases/v2 releases/v1; do
for BRANCH in main releases/v2; do
echo "Updating $BRANCH"
gh api --silent -X "PATCH" "repos/github/codeql-action/branches/$BRANCH/protection/required_status_checks" --input checks.json
done

View File

@@ -1,95 +0,0 @@
# See `unset-environment-old-cli.yml` for reasoning behind the separate tests.
name: PR Check - Test unsetting environment variables for CLI version >= 2.5.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
unset-environment:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210809
- os: ubuntu-latest
version: cached
- os: ubuntu-latest
version: latest
- os: ubuntu-latest
version: nightly-latest
name: Test unsetting environment variables
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
with:
version: ${{ matrix.version }}
- uses: ./../action/init
with:
db-location: ${{ runner.temp }}/customDbLocation
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: env -i PATH="$PATH" HOME="$HOME" ./build.sh
- uses: ./../action/analyze
id: analysis
env:
TEST_MODE: true
- shell: bash
run: |
CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
if [[ ! -d "$CPP_DB" ]] || [[ ! "$CPP_DB" == "${RUNNER_TEMP}/customDbLocation/cpp" ]]; then
echo "::error::Did not create a database for CPP, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/cpp' but actual was '${CPP_DB}'"
exit 1
fi
CSHARP_DB="${{ fromJson(steps.analysis.outputs.db-locations).csharp }}"
if [[ ! -d "$CSHARP_DB" ]] || [[ ! "$CSHARP_DB" == "${RUNNER_TEMP}/customDbLocation/csharp" ]]; then
echo "::error::Did not create a database for C Sharp, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/csharp' but actual was '${CSHARP_DB}'"
exit 1
fi
GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}"
if [[ ! -d "$GO_DB" ]] || [[ ! "$GO_DB" == "${RUNNER_TEMP}/customDbLocation/go" ]]; then
echo "::error::Did not create a database for Go, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/go' but actual was '${GO_DB}'"
exit 1
fi
JAVA_DB="${{ fromJson(steps.analysis.outputs.db-locations).java }}"
if [[ ! -d "$JAVA_DB" ]] || [[ ! "$JAVA_DB" == "${RUNNER_TEMP}/customDbLocation/java" ]]; then
echo "::error::Did not create a database for Java, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/java' but actual was '${JAVA_DB}'"
exit 1
fi
JAVASCRIPT_DB="${{ fromJson(steps.analysis.outputs.db-locations).javascript }}"
if [[ ! -d "$JAVASCRIPT_DB" ]] || [[ ! "$JAVASCRIPT_DB" == "${RUNNER_TEMP}/customDbLocation/javascript" ]]; then
echo "::error::Did not create a database for Javascript, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/javascript' but actual was '${JAVASCRIPT_DB}'"
exit 1
fi
PYTHON_DB="${{ fromJson(steps.analysis.outputs.db-locations).python }}"
if [[ ! -d "$PYTHON_DB" ]] || [[ ! "$PYTHON_DB" == "${RUNNER_TEMP}/customDbLocation/python" ]]; then
echo "::error::Did not create a database for Python, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/python' but actual was '${PYTHON_DB}'"
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -1,89 +0,0 @@
# There was a bug, fixed in CLI v2.5.1, that didn't propagate environment
# variables that the Java tracer needed. Here we test all languages
# except Java for these CLI versions. In `unset-environment-new-cli.yml`
# we test all languages for recent CLI versions.
name: PR Check - Test unsetting environment variables for CLI version < 2.5.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
unset-environment:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: stable-20210308
- os: ubuntu-20.04
version: stable-20210319
name: Test unsetting environment variables
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
with:
version: ${{ matrix.version }}
- uses: ./../action/init
with:
languages: csharp,cpp,go,javascript,python
db-location: ${{ runner.temp }}/customDbLocation
tools: ${{ steps.prepare-test.outputs.tools-url }}
env:
TEST_MODE: true
- name: Build code
shell: bash
run: env -i PATH="$PATH" HOME="$HOME" ./build.sh
- uses: ./../action/analyze
id: analysis
env:
TEST_MODE: true
- shell: bash
run: |
CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}"
if [[ ! -d "$CPP_DB" ]] || [[ ! "$CPP_DB" == "${RUNNER_TEMP}/customDbLocation/cpp" ]]; then
echo "::error::Did not create a database for CPP, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/cpp' but actual was '${CPP_DB}'"
exit 1
fi
CSHARP_DB="${{ fromJson(steps.analysis.outputs.db-locations).csharp }}"
if [[ ! -d "$CSHARP_DB" ]] || [[ ! "$CSHARP_DB" == "${RUNNER_TEMP}/customDbLocation/csharp" ]]; then
echo "::error::Did not create a database for C Sharp, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/csharp' but actual was '${CSHARP_DB}'"
exit 1
fi
GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}"
if [[ ! -d "$GO_DB" ]] || [[ ! "$GO_DB" == "${RUNNER_TEMP}/customDbLocation/go" ]]; then
echo "::error::Did not create a database for Go, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/go' but actual was '${GO_DB}'"
exit 1
fi
JAVASCRIPT_DB="${{ fromJson(steps.analysis.outputs.db-locations).javascript }}"
if [[ ! -d "$JAVASCRIPT_DB" ]] || [[ ! "$JAVASCRIPT_DB" == "${RUNNER_TEMP}/customDbLocation/javascript" ]]; then
echo "::error::Did not create a database for Javascript, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/javascript' but actual was '${JAVASCRIPT_DB}'"
exit 1
fi
PYTHON_DB="${{ fromJson(steps.analysis.outputs.db-locations).python }}"
if [[ ! -d "$PYTHON_DB" ]] || [[ ! "$PYTHON_DB" == "${RUNNER_TEMP}/customDbLocation/python" ]]; then
echo "::error::Did not create a database for Python, or created it in the wrong location." \
"Expected location was '${RUNNER_TEMP}/customDbLocation/python' but actual was '${PYTHON_DB}'"
exit 1
fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

91
.github/workflows/update-bundle.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
name: Update default CodeQL bundle
on:
release:
# From https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
# Note: The prereleased type will not trigger for pre-releases published
# from draft releases, but the published type will trigger. If you want a
# workflow to run when stable and pre-releases publish, subscribe to
# published instead of released and prereleased.
#
# From https://github.com/orgs/community/discussions/26281
# As a work around, in published type workflow, you could add if condition
# to filter pre-release attribute.
types: [published]
jobs:
update-bundle:
if: github.event.release.prerelease && startsWith(github.event.release.tag_name, 'codeql-bundle-')
runs-on: ubuntu-latest
steps:
- name: Dump environment
run: env
- name: Dump GitHub context
env:
GITHUB_CONTEXT: '${{ toJson(github) }}'
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- name: Update git config
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions[bot]"
- name: Update bundle
uses: ./.github/actions/update-bundle
- name: Rebuild Action
run: npm run build
- name: Commit and push changes
env:
RELEASE_TAG: "${{ github.event.release.tag_name }}"
run: |
git checkout -b "update-bundle/$RELEASE_TAG"
git commit -am "Update default bundle to $RELEASE_TAG"
git push --set-upstream origin "update-bundle/$RELEASE_TAG"
- name: Open pull request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cli_version=$(jq -r '.cliVersion' src/defaults.json)
pr_url=$(gh pr create \
--title "Update default bundle to $cli_version" \
--body "This pull request updates the default CodeQL bundle, as used with \`tools: latest\` and on GHES, to $cli_version." \
--assignee "$GITHUB_ACTOR" \
--draft \
)
echo "CLI_VERSION=$cli_version" | tee -a "$GITHUB_ENV"
echo "PR_URL=$pr_url" | tee -a "$GITHUB_ENV"
- name: Create changelog note
shell: python
run: |
import os
import re
# Get the PR number from the PR URL.
pr_number = os.environ['PR_URL'].split('/')[-1]
changelog_note = f"- Update default CodeQL bundle version to {os.environ['CLI_VERSION']}. [#{pr_number}]({os.environ['PR_URL']})"
# If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
# Use perl to avoid having to escape the newline character.
with open('CHANGELOG.md', 'r') as f:
changelog = f.read()
changelog = changelog.replace('## [UNRELEASED]\n\nNo user facing changes.', '## [UNRELEASED]\n')
# Add the changelog note to the bottom of the "[UNRELEASED]" section.
changelog = re.sub(r'\n## (\d+\.\d+\.\d+)', f'{changelog_note}\n\n## \\1', changelog, count=1)
with open('CHANGELOG.md', 'w') as f:
f.write(changelog)
- name: Push changelog note
run: |
git commit -am "Add changelog note"
git push

View File

@@ -27,10 +27,7 @@ jobs:
run: |
git fetch origin "$BRANCH" --depth=1
git checkout "origin/$BRANCH"
sudo npm install --force -g npm@latest
npm install
npm ci
npm run removeNPMAbsolutePaths
.github/workflows/script/update-node-modules.sh update
if [ ! -z "$(git status --porcelain)" ]; then
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions[bot]"

View File

@@ -4,11 +4,6 @@ on:
# This will open a PR to update the v2 release branch.
workflow_dispatch:
# When the v2 release is complete, this workflow will open a PR to update the v1 release branch.
push:
branches:
- releases/v2
jobs:
update:
timeout-minutes: 45
@@ -29,7 +24,7 @@ jobs:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8
@@ -43,20 +38,9 @@ jobs:
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions[bot]"
- name: Update v2 release branch
if: github.event_name == 'workflow_dispatch'
- name: Update release branch
run: |
python .github/update-release-branch.py \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--repository-nwo ${{ github.repository }} \
--mode v2-release \
--conductor ${GITHUB_ACTOR}
- name: Update v1 release branch
if: github.event_name == 'push'
run: |
python .github/update-release-branch.py \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--repository-nwo ${{ github.repository }} \
--mode v1-release \
--conductor ${GITHUB_ACTOR}

View File

@@ -3,6 +3,7 @@ name: Update Supported Enterprise Server Versions
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
update-supported-enterprise-server-versions:
@@ -13,7 +14,7 @@ jobs:
steps:
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Checkout CodeQL Action
@@ -35,7 +36,7 @@ jobs:
env:
ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/
- name: Commit Changes
uses: peter-evans/create-pull-request@c7f493a8000b8aeb17a1332e326ba76b57cb83eb # v3.4.1
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v5.0.1
with:
commit-message: Update supported GitHub Enterprise Server versions.
title: Update supported GitHub Enterprise Server versions.

View File

@@ -15,6 +15,11 @@ def main():
api_compatibility_data = json.loads(_API_COMPATIBILITY_PATH.read_text())
releases = json.loads(_RELEASE_FILE_PATH.read_text())
# Remove GHES version using a previous version numbering scheme.
if "11.10.340" in releases:
del releases["11.10.340"]
oldest_supported_release = None
newest_supported_release = semver.VersionInfo.parse(api_compatibility_data["maximumVersion"] + ".0")

2
.gitignore vendored
View File

@@ -1,4 +1,2 @@
/runner/dist/
/runner/node_modules/
# Ignore for example failing-tests.json from AVA
node_modules/.cache

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
lockfile-version=3

View File

@@ -2,7 +2,146 @@
## [UNRELEASED]
- Update the ML-powered additional query pack for JavaScript to version 0.4.0.
- We are rolling out a feature in May 2023 that will disable Python dependency installation for new users of the CodeQL Action. This improves the speed of analysis while having only a very minor impact on results. [#1676](https://github.com/github/codeql-action/pull/1676)
- We are improving the way that [CodeQL bundles](https://github.com/github/codeql-action/releases) are tagged to make it possible to easily identify bundles by their CodeQL semantic version.
- As of CodeQL CLI 2.13.4, CodeQL bundles will be tagged using semantic versions, for example `codeql-bundle-v2.13.4`, instead of timestamps, like `codeql-bundle-20230615`.
- This change does not affect the majority of workflows, and we will not be changing tags for existing bundle releases.
- Some workflows with custom logic that depends on the specific format of the CodeQL bundle tag may need to be updated. For example, if your workflow matches CodeQL bundle tag names against a `codeql-bundle-yyyymmdd` pattern, you should update it to also recognize `codeql-bundle-vx.y.z` tags.
- Remove the requirement for `on.push` and `on.pull_request` to trigger on the same branches. [#1675](https://github.com/github/codeql-action/pull/1675)
## 2.3.3 - 04 May 2023
- Update default CodeQL bundle version to 2.13.1. [#1664](https://github.com/github/codeql-action/pull/1664)
- You can now configure CodeQL within your code scanning workflow by passing a `config` input to the `init` Action. See [Using a custom configuration file](https://aka.ms/code-scanning-docs/config-file) for more information about configuring code scanning. [#1590](https://github.com/github/codeql-action/pull/1590)
- Updated the SARIF 2.1.0 JSON schema file to the latest from [oasis-tcs/sarif-spec](https://github.com/oasis-tcs/sarif-spec/blob/123e95847b13fbdd4cbe2120fa5e33355d4a042b/Schemata/sarif-schema-2.1.0.json). [#1668](https://github.com/github/codeql-action/pull/1668)
## 2.3.2 - 27 Apr 2023
No user facing changes.
## 2.3.1 - 26 Apr 2023
No user facing changes.
## 2.3.0 - 21 Apr 2023
- Update default CodeQL bundle version to 2.13.0. [#1649](https://github.com/github/codeql-action/pull/1649)
- Bump the minimum CodeQL bundle version to 2.8.5. [#1618](https://github.com/github/codeql-action/pull/1618)
## 2.2.12 - 13 Apr 2023
- Include the value of the `GITHUB_RUN_ATTEMPT` environment variable in the telemetry sent to GitHub. [#1640](https://github.com/github/codeql-action/pull/1640)
- Improve the ease of debugging failed runs configured using [default setup](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#configuring-code-scanning-automatically). The CodeQL Action will now upload diagnostic information to Code Scanning from failed runs configured using default setup. You can view this diagnostic information on the [tool status page](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-the-tool-status-page). [#1619](https://github.com/github/codeql-action/pull/1619)
## 2.2.11 - 06 Apr 2023
No user facing changes.
## 2.2.10 - 05 Apr 2023
- Update default CodeQL bundle version to 2.12.6. [#1629](https://github.com/github/codeql-action/pull/1629)
## 2.2.9 - 27 Mar 2023
- Customers post-processing the SARIF output of the `analyze` Action before uploading it to Code Scanning will benefit from an improved debugging experience. [#1598](https://github.com/github/codeql-action/pull/1598)
- The CodeQL Action will now upload a SARIF file with debugging information to Code Scanning on failed runs for customers using `upload: false`. Previously, this was only available for customers using the default value of the `upload` input.
- The `upload` input to the `analyze` Action now accepts the following values:
- `always` is the default value, which uploads the SARIF file to Code Scanning for successful and failed runs.
- `failure-only` is recommended for customers post-processing the SARIF file before uploading it to Code Scanning. This option uploads debugging information to Code Scanning for failed runs to improve the debugging experience.
- `never` avoids uploading the SARIF file to Code Scanning even if the code scanning run fails. This is not recommended for external users since it complicates debugging.
- The legacy `true` and `false` options will be interpreted as `always` and `failure-only` respectively.
## 2.2.8 - 22 Mar 2023
- Update default CodeQL bundle version to 2.12.5. [#1585](https://github.com/github/codeql-action/pull/1585)
## 2.2.7 - 15 Mar 2023
No user facing changes.
## 2.2.6 - 10 Mar 2023
- Update default CodeQL bundle version to 2.12.4. [#1561](https://github.com/github/codeql-action/pull/1561)
## 2.2.5 - 24 Feb 2023
- Update default CodeQL bundle version to 2.12.3. [#1543](https://github.com/github/codeql-action/pull/1543)
## 2.2.4 - 10 Feb 2023
No user facing changes.
## 2.2.3 - 08 Feb 2023
- Update default CodeQL bundle version to 2.12.2. [#1518](https://github.com/github/codeql-action/pull/1518)
## 2.2.2 - 06 Feb 2023
- Fix an issue where customers using the CodeQL Action with the [CodeQL Action sync tool](https://docs.github.com/en/enterprise-server@3.7/admin/code-security/managing-github-advanced-security-for-your-enterprise/configuring-code-scanning-for-your-appliance#configuring-codeql-analysis-on-a-server-without-internet-access) would not be able to obtain the CodeQL tools. [#1517](https://github.com/github/codeql-action/pull/1517)
## 2.2.1 - 27 Jan 2023
No user facing changes.
## 2.2.0 - 26 Jan 2023
- Improve stability when choosing the default version of CodeQL to use in code scanning workflow runs on Actions on GitHub.com. [#1475](https://github.com/github/codeql-action/pull/1475)
- This change addresses customer reports of code scanning alerts on GitHub.com being closed and reopened during the rollout of new versions of CodeQL in the GitHub Actions [runner images](https://github.com/actions/runner-images).
- **No change is required for the majority of workflows**, including:
- Workflows on GitHub.com hosted runners using the latest version (`v2`) of the CodeQL Action.
- Workflows on GitHub.com hosted runners that are pinned to specific versions of the CodeQL Action from `v2.2.0` onwards.
- Workflows on GitHub Enterprise Server.
- **A change may be required** for workflows on GitHub.com hosted runners that are pinned to specific versions of the CodeQL Action before `v2.2.0` (e.g. `v2.1.32`):
- Previously, these workflows would obtain the latest version of CodeQL from the Actions runner image.
- Now, these workflows will download an older, compatible version of CodeQL from GitHub Releases. To use this older version, no change is required. To use the newest version of CodeQL, please update your workflows to reference the latest version of the CodeQL Action (`v2`).
- **Internal changes**
- These changes will not affect the majority of code scanning workflows. Continue reading only if your workflow uses [@actions/tool-cache](https://github.com/actions/toolkit/tree/main/packages/tool-cache) or relies on the precise location of CodeQL within the Actions tool cache.
- The tool cache now contains **two** recent CodeQL versions (previously **one**).
- Each CodeQL version is located under a directory named after the release date and version number, e.g. CodeQL 2.11.6 is now located under `CodeQL/2.11.6-20221211/x64/codeql` (previously `CodeQL/0.0.0-20221211/x64/codeql`).
- The maximum number of [SARIF runs](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#run-object) per file has been increased from 15 to 20 for users uploading SARIF files to GitHub.com. This change will help ensure that Code Scanning can process SARIF files generated by third-party tools that have many runs. See the [GitHub API documentation](https://docs.github.com/en/rest/code-scanning#upload-an-analysis-as-sarif-data) for a list of all the limits around uploading SARIF. This change will be released to GitHub Enterprise Server as part of GHES 3.9.
- Update default CodeQL bundle version to 2.12.1. [#1498](https://github.com/github/codeql-action/pull/1498)
- Fix a bug that forced the `init` Action to run for at least two minutes on JavaScript. [#1494](https://github.com/github/codeql-action/pull/1494)
## 2.1.39 - 18 Jan 2023
- CodeQL Action v1 is now deprecated, and is no longer updated or supported. For better performance, improved security, and new features, upgrade to v2. For more information, see [this changelog post](https://github.blog/changelog/2023-01-18-code-scanning-codeql-action-v1-is-now-deprecated/). [#1467](https://github.com/github/codeql-action/pull/1466)
- Python automatic dependency installation will no longer fail for projects using Poetry that specify `virtualenvs.options.no-pip = true` in their `poetry.toml`. [#1431](https://github.com/github/codeql-action/pull/1431)
- Avoid printing a stack trace and error message when the action fails to find the SHA at the
current directory. This will happen in several non-error states and so we now avoid cluttering the
log with this message. [#1485](https://github.com/github/codeql-action/pull/1485)
## 2.1.38 - 12 Jan 2023
- Update default CodeQL bundle version to 2.12.0. [#1466](https://github.com/github/codeql-action/pull/1466)
## 2.1.37 - 14 Dec 2022
- Update default CodeQL bundle version to 2.11.6. [#1433](https://github.com/github/codeql-action/pull/1433)
## 2.1.36 - 08 Dec 2022
- Update default CodeQL bundle version to 2.11.5. [#1412](https://github.com/github/codeql-action/pull/1412)
- Add a step that tries to upload a SARIF file for the workflow run when that workflow run fails. This will help better surface failed code scanning workflow runs. [#1393](https://github.com/github/codeql-action/pull/1393)
- Python automatic dependency installation will no longer consider dependency code installed in venv as user-written, for projects using Poetry that specify `virtualenvs.in-project = true` in their `poetry.toml`. [#1419](https://github.com/github/codeql-action/pull/1419)
## 2.1.35 - 01 Dec 2022
No user facing changes.
## 2.1.34 - 25 Nov 2022
- Update default CodeQL bundle version to 2.11.4. [#1391](https://github.com/github/codeql-action/pull/1391)
- Fixed a bug where some the `init` action and the `analyze` action would have different sets of experimental feature flags enabled. [#1384](https://github.com/github/codeql-action/pull/1384)
## 2.1.33 - 16 Nov 2022
- Go is now analyzed in the same way as other compiled languages such as C/C++, C#, and Java. This completes the rollout of the feature described in [CodeQL Action version 2.1.27](#2127---06-oct-2022). [#1322](https://github.com/github/codeql-action/pull/1322)
- Bump the minimum CodeQL bundle version to 2.6.3. [#1358](https://github.com/github/codeql-action/pull/1358)
## 2.1.32 - 14 Nov 2022
- Update default CodeQL bundle version to 2.11.3. [#1348](https://github.com/github/codeql-action/pull/1348)
- Update the ML-powered additional query pack for JavaScript to version 0.4.0. [#1351](https://github.com/github/codeql-action/pull/1351)
## 2.1.31 - 04 Nov 2022
@@ -32,7 +171,7 @@
## 2.1.25 - 21 Sep 2022
- We will soon be rolling out a feature of the CodeQL Action that stores some information used to make future runs faster in the GitHub Actions cache. Initially, this will only be enabled on JavaScript repositories, but we plan to add more languages to this soon. The new feature can be disabled by passing the `trap-caching: false` option to your workflow's `init` step, for example if you are already using the GitHub Actions cache for a different purpose and are near the storage limit for it.
- Add support for Python automatic dependency installation with Poetry 1.2 [#1258](https://github.com/github/codeql-action/pull/1258).
- Add support for Python automatic dependency installation with Poetry 1.2 [#1258](https://github.com/github/codeql-action/pull/1258)
## 2.1.24 - 16 Sep 2022
@@ -284,7 +423,7 @@ No user facing changes.
## 1.0.4 - 28 Jun 2021
- Fix `RUNNER_TEMP environment variable must be set` when using runner. [#594](https://github.com/github/codeql-action/pull/594)
- Fix couting of lines of code for C# projects. [#586](https://github.com/github/codeql-action/pull/586)
- Fix counting of lines of code for C# projects. [#586](https://github.com/github/codeql-action/pull/586)
## 1.0.3 - 23 Jun 2021

View File

@@ -38,10 +38,6 @@ To see the effect of your changes and to test them, push your changes in a branc
As well as the unit tests (see _Common tasks_ above), there are integration tests, defined in `.github/workflows/integration-testing.yml`. These are run by a CI check. Depending on the change youre making, you may want to add a test to this file or extend an existing one.
### Building the CodeQL runner
Navigate to the `runner` directory and run `npm install` to install dependencies needed only for compiling the CodeQL runner. Run `npm run build-runner` to output files to the `runner/dist` directory.
## Submitting a pull request
1. [Fork][fork] and clone the repository
@@ -71,12 +67,8 @@ Here are a few things you can do that will increase the likelihood of your pull
This mergeback incorporates the changelog updates into `main`, tags the release using the merge commit of the "Merge main into releases/v2" pull request, and bumps the patch version of the CodeQL Action.
Approve the mergeback PR and automerge it.
1. When the "Merge main into releases/v2" pull request is merged into the `releases/v2` branch, the "Update release branch" workflow will create a "Merge releases/v2 into releases/v1" pull request to merge the changes since the last release into the `releases/v1` release branch.
This ensures we keep both the `releases/v1` and `releases/v2` release branches up to date and fully supported.
Review the checklist items in the pull request description.
Once you've checked off all the items, approve the PR and automerge it.
1. Once the mergeback has been merged to `main` and the "Merge releases/v2 into releases/v1" PR has been merged to `releases/v1`, the release is complete.
Once the mergeback has been merged to `main`, the release is complete.
## Keeping the PR checks up to date (admin access required)

View File

@@ -1,6 +1,6 @@
# CodeQL Action
This action runs GitHub's industry-leading semantic code analysis engine, CodeQL, against a repository's source code to find security vulnerabilities. It then automatically uploads the results to GitHub so they can be displayed in the repository's security tab. CodeQL runs an extensible set of [queries](https://github.com/github/codeql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code.
This action runs GitHub's industry-leading semantic code analysis engine, [CodeQL](https://codeql.github.com/), against a repository's source code to find security vulnerabilities. It then automatically uploads the results to GitHub so they can be displayed in the repository's security tab. CodeQL runs an extensible set of [queries](https://github.com/github/codeql), which have been developed by the community and the [GitHub Security Lab](https://securitylab.github.com/) to find common vulnerabilities in your code.
For a list of recent changes, see the CodeQL Action's [changelog](CHANGELOG.md).
@@ -59,7 +59,7 @@ jobs:
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# languages: go, javascript, csharp, python, cpp, java, ruby
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
@@ -135,7 +135,38 @@ By default, this will override any queries specified in a config file. If you wi
queries: +<local-or-remote-query>,<another-query>
```
### Configuration via `config` input
You can alternatively configure CodeQL using the `config` input to the `init` Action. The value of this input must be a YAML string that follows the configuration file format documented at "[Using a custom configuration file](https://aka.ms/code-scanning-docs/config-file)."
#### Example configuration
```yaml
- uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config: |
disable-default-queries: true
queries:
- uses: security-extended
- uses: security-and-quality
query-filters:
- include:
tags: /cwe-020/
```
#### Sharing configuration across multiple repositories
You can use Actions or environment variables to share configuration across multiple repositories and to modify configuration without needing to edit the workflow file. In the following example, `vars.CODEQL_CONF` is an [Actions configuration variable](https://docs.github.com/en/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows):
```yaml
- uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config: ${{ vars.CODEQL_CONF }}
```
## Troubleshooting
Read about [troubleshooting code scanning](https://help.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning).

View File

@@ -10,9 +10,14 @@ inputs:
required: false
default: "../results"
upload:
description: Upload the SARIF file to Code Scanning
description: >-
Upload the SARIF file to Code Scanning.
Defaults to 'always' which uploads the SARIF file to Code Scanning for successful and failed runs.
'failure-only' only uploads debugging information to Code Scanning if the workflow run fails, for users post-processing the SARIF file before uploading it to Code Scanning.
'never' avoids uploading the SARIF file to Code Scanning, even if the code scanning run fails. This is not recommended for external users since it complicates debugging.
required: false
default: "true"
# If changing this, make sure to update workflow.ts accordingly.
default: "always"
cleanup-level:
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
required: false
@@ -44,6 +49,7 @@ inputs:
checkout_path:
description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file."
required: false
# If changing this, make sure to update workflow.ts accordingly.
default: ${{ github.workspace }}
ref:
description: "The ref where results will be uploaded. If not provided, the Action will use the GITHUB_REF environment variable. If provided, the sha input must be provided as well. This input is not available in pull requests from forks."

View File

@@ -44,6 +44,9 @@ inputs:
db-location:
description: Path where CodeQL databases should be created. If not specified, a temporary directory will be used.
required: false
config:
description: Configuration passed as a YAML string in the same format as the config-file input. This takes precedence over the config-file input.
required: false
queries:
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
required: false

322
lib/actions-util.js generated
View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
@@ -19,29 +23,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.workflowEventName = exports.sendStatusReport = exports.createStatusReportBase = exports.getActionsStatus = exports.getRef = exports.computeAutomationID = exports.getAutomationID = exports.getAnalysisKey = exports.getWorkflowRunID = exports.getWorkflow = exports.formatWorkflowCause = exports.formatWorkflowErrors = exports.validateWorkflow = exports.getWorkflowErrors = exports.WorkflowErrors = exports.patternIsSuperset = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0;
exports.getUploadValue = exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.workflowEventName = exports.sendStatusReport = exports.createStatusReportBase = exports.getActionVersion = exports.getActionsStatus = exports.getRef = exports.computeAutomationID = exports.getAutomationID = exports.getAnalysisKey = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0;
const fs = __importStar(require("fs"));
const os = __importStar(require("os"));
const path = __importStar(require("path"));
const core = __importStar(require("@actions/core"));
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
const safeWhich = __importStar(require("@chrisgavin/safe-which"));
const yaml = __importStar(require("js-yaml"));
const api = __importStar(require("./api-client"));
const sharedEnv = __importStar(require("./shared-environment"));
const util_1 = require("./util");
const workflow_1 = require("./workflow");
// eslint-disable-next-line import/no-commonjs
const pkg = require("../package.json");
/**
* The utils in this module are meant to be run inside of the action only.
* Code paths from the runner should not enter this module.
*/
/**
* Wrapper around core.getInput for inputs that always have a value.
* Also see getOptionalInput.
*
* This allows us to get stronger type checking of required/optional inputs
* and make behaviour more consistent between actions and the runner.
* This allows us to get stronger type checking of required/optional inputs.
*/
function getRequiredInput(name) {
return core.getInput(name, { required: true });
@@ -51,8 +50,7 @@ exports.getRequiredInput = getRequiredInput;
* Wrapper around core.getInput that converts empty inputs to undefined.
* Also see getRequiredInput.
*
* This allows us to get stronger type checking of required/optional inputs
* and make behaviour more consistent between actions and the runner.
* This allows us to get stronger type checking of required/optional inputs.
*/
const getOptionalInput = function (name) {
const value = core.getInput(name);
@@ -94,8 +92,9 @@ const getCommitOid = async function (checkoutPath, ref = "HEAD") {
return commitOid.trim();
}
catch (e) {
core.info(`Failed to call git to get current commit. Continuing with data from environment or input: ${e}`);
core.info(e.stack || "NO STACK");
core.info("Could not determine current commit SHA using git. Continuing with data from user input or environment.");
core.debug(`Reason: ${e.message}`);
core.debug(e.stack || "NO STACK");
return (0, exports.getOptionalInput)("sha") || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
}
};
@@ -151,225 +150,6 @@ const determineMergeBaseCommitOid = async function () {
}
};
exports.determineMergeBaseCommitOid = determineMergeBaseCommitOid;
function isObject(o) {
return o !== null && typeof o === "object";
}
const GLOB_PATTERN = new RegExp("(\\*\\*?)");
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
}
function patternToRegExp(value) {
return new RegExp(`^${value
.toString()
.split(GLOB_PATTERN)
.reduce(function (arr, cur) {
if (cur === "**") {
arr.push(".*?");
}
else if (cur === "*") {
arr.push("[^/]*?");
}
else if (cur) {
arr.push(escapeRegExp(cur));
}
return arr;
}, [])
.join("")}$`);
}
// this function should return true if patternA is a superset of patternB
// e.g: * is a superset of main-* but main-* is not a superset of *.
function patternIsSuperset(patternA, patternB) {
return patternToRegExp(patternA).test(patternB);
}
exports.patternIsSuperset = patternIsSuperset;
function branchesToArray(branches) {
if (typeof branches === "string") {
return [branches];
}
if (Array.isArray(branches)) {
if (branches.length === 0) {
return "**";
}
return branches;
}
return "**";
}
function toCodedErrors(errors) {
return Object.entries(errors).reduce((acc, [key, value]) => {
acc[key] = { message: value, code: key };
return acc;
}, {});
}
// code to send back via status report
// message to add as a warning annotation to the run
exports.WorkflowErrors = toCodedErrors({
MismatchedBranches: `Please make sure that every branch in on.pull_request is also in on.push so that Code Scanning can compare pull requests against the state of the base branch.`,
MissingPushHook: `Please specify an on.push hook so that Code Scanning can compare pull requests against the state of the base branch.`,
PathsSpecified: `Using on.push.paths can prevent Code Scanning annotating new alerts in your pull requests.`,
PathsIgnoreSpecified: `Using on.push.paths-ignore can prevent Code Scanning annotating new alerts in your pull requests.`,
CheckoutWrongHead: `git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.`,
});
function getWorkflowErrors(doc) {
var _a, _b, _c, _d, _e;
const errors = [];
const jobName = process.env.GITHUB_JOB;
if (jobName) {
const job = (_a = doc === null || doc === void 0 ? void 0 : doc.jobs) === null || _a === void 0 ? void 0 : _a[jobName];
const steps = job === null || job === void 0 ? void 0 : job.steps;
if (Array.isArray(steps)) {
for (const step of steps) {
// this was advice that we used to give in the README
// we actually want to run the analysis on the merge commit
// to produce results that are more inline with expectations
// (i.e: this is what will happen if you merge this PR)
// and avoid some race conditions
if ((step === null || step === void 0 ? void 0 : step.run) === "git checkout HEAD^2") {
errors.push(exports.WorkflowErrors.CheckoutWrongHead);
break;
}
}
}
}
let missingPush = false;
if (doc.on === undefined) {
// this is not a valid config
}
else if (typeof doc.on === "string") {
if (doc.on === "pull_request") {
missingPush = true;
}
}
else if (Array.isArray(doc.on)) {
const hasPush = doc.on.includes("push");
const hasPullRequest = doc.on.includes("pull_request");
if (hasPullRequest && !hasPush) {
missingPush = true;
}
}
else if (isObject(doc.on)) {
const hasPush = Object.prototype.hasOwnProperty.call(doc.on, "push");
const hasPullRequest = Object.prototype.hasOwnProperty.call(doc.on, "pull_request");
if (!hasPush && hasPullRequest) {
missingPush = true;
}
if (hasPush && hasPullRequest) {
const paths = (_b = doc.on.push) === null || _b === void 0 ? void 0 : _b.paths;
// if you specify paths or paths-ignore you can end up with commits that have no baseline
// if they didn't change any files
// currently we cannot go back through the history and find the most recent baseline
if (Array.isArray(paths) && paths.length > 0) {
errors.push(exports.WorkflowErrors.PathsSpecified);
}
const pathsIgnore = (_c = doc.on.push) === null || _c === void 0 ? void 0 : _c["paths-ignore"];
if (Array.isArray(pathsIgnore) && pathsIgnore.length > 0) {
errors.push(exports.WorkflowErrors.PathsIgnoreSpecified);
}
}
// if doc.on.pull_request is null that means 'all branches'
// if doc.on.pull_request is undefined that means 'off'
// we only want to check for mismatched branches if pull_request is on.
if (doc.on.pull_request !== undefined) {
const push = branchesToArray((_d = doc.on.push) === null || _d === void 0 ? void 0 : _d.branches);
if (push !== "**") {
const pull_request = branchesToArray((_e = doc.on.pull_request) === null || _e === void 0 ? void 0 : _e.branches);
if (pull_request !== "**") {
const difference = pull_request.filter((value) => !push.some((o) => patternIsSuperset(o, value)));
if (difference.length > 0) {
// there are branches in pull_request that may not have a baseline
// because we are not building them on push
errors.push(exports.WorkflowErrors.MismatchedBranches);
}
}
else if (push.length > 0) {
// push is set up to run on a subset of branches
// and you could open a PR against a branch with no baseline
errors.push(exports.WorkflowErrors.MismatchedBranches);
}
}
}
}
if (missingPush) {
errors.push(exports.WorkflowErrors.MissingPushHook);
}
return errors;
}
exports.getWorkflowErrors = getWorkflowErrors;
async function validateWorkflow() {
let workflow;
try {
workflow = await getWorkflow();
}
catch (e) {
return `error: getWorkflow() failed: ${String(e)}`;
}
let workflowErrors;
try {
workflowErrors = getWorkflowErrors(workflow);
}
catch (e) {
return `error: getWorkflowErrors() failed: ${String(e)}`;
}
if (workflowErrors.length > 0) {
let message;
try {
message = formatWorkflowErrors(workflowErrors);
}
catch (e) {
return `error: formatWorkflowErrors() failed: ${String(e)}`;
}
core.warning(message);
}
return formatWorkflowCause(workflowErrors);
}
exports.validateWorkflow = validateWorkflow;
function formatWorkflowErrors(errors) {
const issuesWere = errors.length === 1 ? "issue was" : "issues were";
const errorsList = errors.map((e) => e.message).join(" ");
return `${errors.length} ${issuesWere} detected with this workflow: ${errorsList}`;
}
exports.formatWorkflowErrors = formatWorkflowErrors;
function formatWorkflowCause(errors) {
if (errors.length === 0) {
return undefined;
}
return errors.map((e) => e.code).join(",");
}
exports.formatWorkflowCause = formatWorkflowCause;
async function getWorkflow() {
const relativePath = await getWorkflowPath();
const absolutePath = path.join((0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"), relativePath);
return yaml.load(fs.readFileSync(absolutePath, "utf-8"));
}
exports.getWorkflow = getWorkflow;
/**
* Get the path of the currently executing workflow.
*/
async function getWorkflowPath() {
const repo_nwo = (0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY").split("/");
const owner = repo_nwo[0];
const repo = repo_nwo[1];
const run_id = Number((0, util_1.getRequiredEnvParam)("GITHUB_RUN_ID"));
const apiClient = api.getActionsApiClient();
const runsResponse = await apiClient.request("GET /repos/:owner/:repo/actions/runs/:run_id?exclude_pull_requests=true", {
owner,
repo,
run_id,
});
const workflowUrl = runsResponse.data.workflow_url;
const workflowResponse = await apiClient.request(`GET ${workflowUrl}`);
return workflowResponse.data.path;
}
/**
* Get the workflow run ID.
*/
function getWorkflowRunID() {
const workflowRunID = parseInt((0, util_1.getRequiredEnvParam)("GITHUB_RUN_ID"), 10);
if (Number.isNaN(workflowRunID)) {
throw new Error("GITHUB_RUN_ID must define a non NaN workflow run ID");
}
return workflowRunID;
}
exports.getWorkflowRunID = getWorkflowRunID;
/**
* Get the analysis key parameter for the current job.
*
@@ -383,7 +163,7 @@ async function getAnalysisKey() {
if (analysisKey !== undefined) {
return analysisKey;
}
const workflowPath = await getWorkflowPath();
const workflowPath = await (0, workflow_1.getWorkflowRelativePath)();
const jobName = (0, util_1.getRequiredEnvParam)("GITHUB_JOB");
analysisKey = `${workflowPath}:${jobName}`;
core.exportVariable(analysisKeyEnvVar, analysisKey);
@@ -398,10 +178,10 @@ async function getAutomationID() {
exports.getAutomationID = getAutomationID;
function computeAutomationID(analysis_key, environment) {
let automationID = `${analysis_key}/`;
// the id has to be deterministic so we sort the fields
if (environment !== undefined && environment !== "null") {
const environmentObject = JSON.parse(environment);
for (const entry of Object.entries(environmentObject).sort()) {
const matrix = (0, util_1.parseMatrixInput)(environment);
if (matrix !== undefined) {
// the id has to be deterministic so we sort the fields
for (const entry of Object.entries(matrix).sort()) {
if (typeof entry[1] === "string") {
automationID += `${entry[0]}:${entry[1]}/`;
}
@@ -432,7 +212,7 @@ async function getRef() {
if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) {
throw new Error("Both 'ref' and 'sha' are required if one of them is provided.");
}
const ref = refInput || (0, util_1.getRequiredEnvParam)("GITHUB_REF");
const ref = refInput || getRefFromEnv();
const sha = shaInput || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
// If the ref is a user-provided input, we have to skip logic
// and assume that it is really where they want to upload the results.
@@ -465,6 +245,26 @@ async function getRef() {
}
}
exports.getRef = getRef;
function getRefFromEnv() {
// To workaround a limitation of Actions dynamic workflows not setting
// the GITHUB_REF in some cases, we accept also the ref within the
// CODE_SCANNING_REF variable. When possible, however, we prefer to use
// the GITHUB_REF as that is a protected variable and cannot be overwritten.
let refEnv;
try {
refEnv = (0, util_1.getRequiredEnvParam)("GITHUB_REF");
}
catch (e) {
// If the GITHUB_REF is not set, we try to rescue by getting the
// CODE_SCANNING_REF.
const maybeRef = process.env["CODE_SCANNING_REF"];
if (maybeRef === undefined || maybeRef.length === 0) {
throw e;
}
refEnv = maybeRef;
}
return refEnv;
}
function getActionsStatus(error, otherFailureCause) {
if (error || otherFailureCause) {
return error instanceof util_1.UserError ? "user-error" : "failure";
@@ -474,6 +274,10 @@ function getActionsStatus(error, otherFailureCause) {
}
}
exports.getActionsStatus = getActionsStatus;
function getActionVersion() {
return pkg.version;
}
exports.getActionVersion = getActionVersion;
/**
* Compose a StatusReport.
*
@@ -486,11 +290,8 @@ exports.getActionsStatus = getActionsStatus;
async function createStatusReportBase(actionName, status, actionStartedAt, cause, exception) {
const commitOid = (0, exports.getOptionalInput)("sha") || process.env["GITHUB_SHA"] || "";
const ref = await getRef();
const workflowRunIDStr = process.env["GITHUB_RUN_ID"];
let workflowRunID = -1;
if (workflowRunIDStr) {
workflowRunID = parseInt(workflowRunIDStr, 10);
}
const workflowRunID = (0, workflow_1.getWorkflowRunID)();
const workflowRunAttempt = (0, workflow_1.getWorkflowRunAttempt)();
const workflowName = process.env["GITHUB_WORKFLOW"] || "";
const jobName = process.env["GITHUB_JOB"] || "";
const analysis_key = await getAnalysisKey();
@@ -510,6 +311,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
}
const statusReport = {
workflow_run_id: workflowRunID,
workflow_run_attempt: workflowRunAttempt,
workflow_name: workflowName,
job_name: jobName,
analysis_key,
@@ -523,7 +325,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
status,
testing_environment: testingEnvironment,
runner_os: runnerOs,
action_version: pkg.version,
action_version: getActionVersion(),
};
// Add optional parameters
if (cause) {
@@ -579,7 +381,7 @@ async function sendStatusReport(statusReport) {
}
const nwo = (0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY");
const [owner, repo] = nwo.split("/");
const client = api.getActionsApiClient();
const client = api.getApiClient();
try {
await client.request("PUT /repos/:owner/:repo/code-scanning/analysis/status", {
owner,
@@ -674,15 +476,19 @@ function getWorkflowEvent() {
function removeRefsHeadsPrefix(ref) {
return ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref;
}
// Is the version of the repository we are currently analyzing from the default branch,
// or alternatively from another branch or a pull request.
// Returns whether we are analyzing the default branch for the repository.
// For cases where the repository information might not be available (e.g.,
// dynamic workflows), this can be forced by the environment variable
// CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH.
async function isAnalyzingDefaultBranch() {
var _a;
if (process.env.CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH === "true") {
return true;
}
// Get the current ref and trim and refs/heads/ prefix
let currentRef = await getRef();
currentRef = removeRefsHeadsPrefix(currentRef);
const event = getWorkflowEvent();
let defaultBranch = (_a = event === null || event === void 0 ? void 0 : event.repository) === null || _a === void 0 ? void 0 : _a.default_branch;
let defaultBranch = event?.repository?.default_branch;
if (process.env.GITHUB_EVENT_NAME === "schedule") {
defaultBranch = removeRefsHeadsPrefix((0, util_1.getRequiredEnvParam)("GITHUB_REF"));
}
@@ -718,4 +524,22 @@ async function printDebugLogs(config) {
}
}
exports.printDebugLogs = printDebugLogs;
// Parses the `upload` input into an `UploadKind`, converting unspecified and deprecated upload inputs appropriately.
function getUploadValue(input) {
switch (input) {
case undefined:
case "true":
case "always":
return "always";
case "false":
case "failure-only":
return "failure-only";
case "never":
return "never";
default:
core.warning(`Unrecognized 'upload' input to 'analyze' Action: ${input}. Defaulting to 'always'.`);
return "always";
}
}
exports.getUploadValue = getUploadValue;
//# sourceMappingURL=actions-util.js.map

File diff suppressed because one or more lines are too long

370
lib/actions-util.test.js generated
View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
@@ -25,14 +29,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const ava_1 = __importDefault(require("ava"));
const yaml = __importStar(require("js-yaml"));
const sinon = __importStar(require("sinon"));
const actionsutil = __importStar(require("./actions-util"));
const testing_utils_1 = require("./testing-utils");
const util_1 = require("./util");
function errorCodes(actual, expected) {
return [actual.map(({ code }) => code), expected.map(({ code }) => code)];
}
(0, testing_utils_1.setupTests)(ava_1.default);
(0, ava_1.default)("getRef() throws on the empty string", async (t) => {
process.env["GITHUB_REF"] = "";
@@ -98,6 +98,30 @@ function errorCodes(actual, expected) {
getAdditionalInputStub.restore();
});
});
(0, ava_1.default)("getRef() returns CODE_SCANNING_REF as a fallback for GITHUB_REF", async (t) => {
await (0, util_1.withTmpDir)(async (tmpDir) => {
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
const expectedRef = "refs/pull/1/HEAD";
const currentSha = "a".repeat(40);
process.env["CODE_SCANNING_REF"] = expectedRef;
process.env["GITHUB_REF"] = "";
process.env["GITHUB_SHA"] = currentSha;
const actualRef = await actionsutil.getRef();
t.deepEqual(actualRef, expectedRef);
});
});
(0, ava_1.default)("getRef() returns GITHUB_REF over CODE_SCANNING_REF if both are provided", async (t) => {
await (0, util_1.withTmpDir)(async (tmpDir) => {
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
const expectedRef = "refs/pull/1/merge";
const currentSha = "a".repeat(40);
process.env["CODE_SCANNING_REF"] = "refs/pull/1/HEAD";
process.env["GITHUB_REF"] = expectedRef;
process.env["GITHUB_SHA"] = currentSha;
const actualRef = await actionsutil.getRef();
t.deepEqual(actualRef, expectedRef);
});
});
(0, ava_1.default)("getRef() throws an error if only `ref` is provided as an input", async (t) => {
await (0, util_1.withTmpDir)(async (tmpDir) => {
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
@@ -143,342 +167,14 @@ function errorCodes(actual, expected) {
actualAutomationID = actionsutil.computeAutomationID(".github/workflows/codeql-analysis.yml:analyze", undefined);
t.deepEqual(actualAutomationID, ".github/workflows/codeql-analysis.yml:analyze/");
});
(0, ava_1.default)("getWorkflowErrors() when on is empty", (t) => {
const errors = actionsutil.getWorkflowErrors({ on: {} });
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.push is an array missing pull_request", (t) => {
const errors = actionsutil.getWorkflowErrors({ on: ["push"] });
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.push is an array missing push", (t) => {
const errors = actionsutil.getWorkflowErrors({ on: ["pull_request"] });
t.deepEqual(...errorCodes(errors, [actionsutil.WorkflowErrors.MissingPushHook]));
});
(0, ava_1.default)("getWorkflowErrors() when on.push is valid", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: ["push", "pull_request"],
});
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.push is a valid superset", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: ["push", "pull_request", "schedule"],
});
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.push should not have a path", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: {
push: { branches: ["main"], paths: ["test/*"] },
pull_request: { branches: ["main"] },
},
});
t.deepEqual(...errorCodes(errors, [actionsutil.WorkflowErrors.PathsSpecified]));
});
(0, ava_1.default)("getWorkflowErrors() when on.push is a correct object", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: { push: { branches: ["main"] }, pull_request: { branches: ["main"] } },
});
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.pull_requests is a string", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: { push: { branches: ["main"] }, pull_request: { branches: "*" } },
});
t.deepEqual(...errorCodes(errors, [actionsutil.WorkflowErrors.MismatchedBranches]));
});
(0, ava_1.default)("getWorkflowErrors() when on.pull_requests is a string and correct", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: { push: { branches: "*" }, pull_request: { branches: "*" } },
});
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.push is correct with empty objects", (t) => {
const errors = actionsutil.getWorkflowErrors(yaml.load(`
on:
push:
pull_request:
`));
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.push is mismatched", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: {
push: { branches: ["main"] },
pull_request: { branches: ["feature"] },
},
});
t.deepEqual(...errorCodes(errors, [actionsutil.WorkflowErrors.MismatchedBranches]));
});
(0, ava_1.default)("getWorkflowErrors() when on.push is not mismatched", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: {
push: { branches: ["main", "feature"] },
pull_request: { branches: ["main"] },
},
});
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.push is mismatched for pull_request", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: {
push: { branches: ["main"] },
pull_request: { branches: ["main", "feature"] },
},
});
t.deepEqual(...errorCodes(errors, [actionsutil.WorkflowErrors.MismatchedBranches]));
});
(0, ava_1.default)("getWorkflowErrors() for a range of malformed workflows", (t) => {
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: {
push: 1,
pull_request: 1,
},
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: 1,
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: 1,
jobs: 1,
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: 1,
jobs: [1],
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: 1,
jobs: { 1: 1 },
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: 1,
jobs: { test: 1 },
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: 1,
jobs: { test: [1] },
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: 1,
jobs: { test: { steps: 1 } },
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: 1,
jobs: { test: { steps: [{ notrun: "git checkout HEAD^2" }] } },
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: 1,
jobs: { test: [undefined] },
}), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors(1), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors({
on: {
push: {
branches: 1,
},
pull_request: {
branches: 1,
},
},
}), []));
});
(0, ava_1.default)("getWorkflowErrors() when on.pull_request for every branch but push specifies branches", (t) => {
const errors = actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
on:
push:
branches: ["main"]
pull_request:
`));
t.deepEqual(...errorCodes(errors, [actionsutil.WorkflowErrors.MismatchedBranches]));
});
(0, ava_1.default)("getWorkflowErrors() when on.pull_request for wildcard branches", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: {
push: { branches: ["feature/*"] },
pull_request: { branches: "feature/moose" },
},
});
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.pull_request for mismatched wildcard branches", (t) => {
const errors = actionsutil.getWorkflowErrors({
on: {
push: { branches: ["feature/moose"] },
pull_request: { branches: "feature/*" },
},
});
t.deepEqual(...errorCodes(errors, [actionsutil.WorkflowErrors.MismatchedBranches]));
});
(0, ava_1.default)("getWorkflowErrors() when HEAD^2 is checked out", (t) => {
process.env.GITHUB_JOB = "test";
const errors = actionsutil.getWorkflowErrors({
on: ["push", "pull_request"],
jobs: { test: { steps: [{ run: "git checkout HEAD^2" }] } },
});
t.deepEqual(...errorCodes(errors, [actionsutil.WorkflowErrors.CheckoutWrongHead]));
});
(0, ava_1.default)("formatWorkflowErrors() when there is one error", (t) => {
const message = actionsutil.formatWorkflowErrors([
actionsutil.WorkflowErrors.CheckoutWrongHead,
]);
t.true(message.startsWith("1 issue was detected with this workflow:"));
});
(0, ava_1.default)("formatWorkflowErrors() when there are multiple errors", (t) => {
const message = actionsutil.formatWorkflowErrors([
actionsutil.WorkflowErrors.CheckoutWrongHead,
actionsutil.WorkflowErrors.PathsSpecified,
]);
t.true(message.startsWith("2 issues were detected with this workflow:"));
});
(0, ava_1.default)("formatWorkflowCause() with no errors", (t) => {
const message = actionsutil.formatWorkflowCause([]);
t.deepEqual(message, undefined);
});
(0, ava_1.default)("formatWorkflowCause()", (t) => {
const message = actionsutil.formatWorkflowCause([
actionsutil.WorkflowErrors.CheckoutWrongHead,
actionsutil.WorkflowErrors.PathsSpecified,
]);
t.deepEqual(message, "CheckoutWrongHead,PathsSpecified");
t.deepEqual(actionsutil.formatWorkflowCause([]), undefined);
});
(0, ava_1.default)("patternIsSuperset()", (t) => {
t.false(actionsutil.patternIsSuperset("main-*", "main"));
t.true(actionsutil.patternIsSuperset("*", "*"));
t.true(actionsutil.patternIsSuperset("*", "main-*"));
t.false(actionsutil.patternIsSuperset("main-*", "*"));
t.false(actionsutil.patternIsSuperset("main-*", "main"));
t.true(actionsutil.patternIsSuperset("main", "main"));
t.false(actionsutil.patternIsSuperset("*", "feature/*"));
t.true(actionsutil.patternIsSuperset("**", "feature/*"));
t.false(actionsutil.patternIsSuperset("feature-*", "**"));
t.false(actionsutil.patternIsSuperset("a/**/c", "a/**/d"));
t.false(actionsutil.patternIsSuperset("a/**/c", "a/**"));
t.true(actionsutil.patternIsSuperset("a/**", "a/**/c"));
t.true(actionsutil.patternIsSuperset("a/**/c", "a/main-**/c"));
t.false(actionsutil.patternIsSuperset("a/**/b/**/c", "a/**/d/**/c"));
t.true(actionsutil.patternIsSuperset("a/**/b/**/c", "a/**/b/c/**/c"));
t.true(actionsutil.patternIsSuperset("a/**/b/**/c", "a/**/b/d/**/c"));
t.false(actionsutil.patternIsSuperset("a/**/c/d/**/c", "a/**/b/**/c"));
t.false(actionsutil.patternIsSuperset("a/main-**/c", "a/**/c"));
t.true(actionsutil.patternIsSuperset("/robin/*/release/*", "/robin/moose/release/goose"));
t.false(actionsutil.patternIsSuperset("/robin/moose/release/goose", "/robin/*/release/*"));
});
(0, ava_1.default)("getWorkflowErrors() when branches contain dots", (t) => {
const errors = actionsutil.getWorkflowErrors(yaml.load(`
on:
push:
branches: [4.1, master]
pull_request:
# The branches below must be a subset of the branches above
branches: [4.1, master]
`));
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on.push has a trailing comma", (t) => {
const errors = actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
on:
push:
branches: [master, ]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
`));
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() should only report the current job's CheckoutWrongHead", (t) => {
process.env.GITHUB_JOB = "test";
const errors = actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
jobs:
test:
steps:
- run: "git checkout HEAD^2"
test2:
steps:
- run: "git checkout HEAD^2"
test3:
steps: []
`));
t.deepEqual(...errorCodes(errors, [actionsutil.WorkflowErrors.CheckoutWrongHead]));
});
(0, ava_1.default)("getWorkflowErrors() should not report a different job's CheckoutWrongHead", (t) => {
process.env.GITHUB_JOB = "test3";
const errors = actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
jobs:
test:
steps:
- run: "git checkout HEAD^2"
test2:
steps:
- run: "git checkout HEAD^2"
test3:
steps: []
`));
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() when on is missing", (t) => {
const errors = actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
`));
t.deepEqual(...errorCodes(errors, []));
});
(0, ava_1.default)("getWorkflowErrors() with a different on setup", (t) => {
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
on: "workflow_dispatch"
`)), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
on: [workflow_dispatch]
`)), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
on:
workflow_dispatch: {}
`)), []));
});
(0, ava_1.default)("getWorkflowErrors() should not report an error if PRs are totally unconfigured", (t) => {
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
on:
push:
branches: [master]
`)), []));
t.deepEqual(...errorCodes(actionsutil.getWorkflowErrors(yaml.load(`
name: "CodeQL"
on: ["push"]
`)), []));
});
(0, ava_1.default)("initializeEnvironment", (t) => {
(0, util_1.initializeEnvironment)(util_1.Mode.actions, "1.2.3");
t.deepEqual((0, util_1.getMode)(), util_1.Mode.actions);
(0, util_1.initializeEnvironment)("1.2.3");
t.deepEqual(process.env.CODEQL_ACTION_VERSION, "1.2.3");
(0, util_1.initializeEnvironment)(util_1.Mode.runner, "4.5.6");
t.deepEqual((0, util_1.getMode)(), util_1.Mode.runner);
t.deepEqual(process.env.CODEQL_ACTION_VERSION, "4.5.6");
});
(0, ava_1.default)("isAnalyzingDefaultBranch()", async (t) => {
process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "true";
t.deepEqual(await actionsutil.isAnalyzingDefaultBranch(), true);
process.env["CODE_SCANNING_IS_ANALYZING_DEFAULT_BRANCH"] = "false";
await (0, util_1.withTmpDir)(async (tmpDir) => {
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
const envFile = path.join(tmpDir, "event.json");

File diff suppressed because one or more lines are too long

6
lib/analysis-paths.js generated
View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];

View File

@@ -1 +1 @@
{"version":3,"file":"analysis-paths.js","sourceRoot":"","sources":["../src/analysis-paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAK7B,SAAS,qBAAqB,CAAC,QAAQ;IACrC,OAAO,CACL,QAAQ,KAAK,YAAY,IAAI,QAAQ,KAAK,QAAQ,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Q,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3E,IAAI,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IACrC,IACE,CAAC,qBAAqB,CAAC,UAAU,CAAC,IAAI,CAAC;QACvC,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,EACvC;QACA,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;KACzD;IACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QAC5B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;KAC5E;IAED,yEAAyE;IACzE,6EAA6E;IAC7E,wDAAwD;IACxD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;IACzD,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACxD;AACH,CAAC;AAjCD,wEAiCC"}

View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];

View File

@@ -1 +1 @@
{"version":3,"file":"analysis-paths.test.js","sourceRoot":"","sources":["../src/analysis-paths.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,8CAAuB;AAEvB,gEAAkD;AAClD,mDAA6C;AAC7C,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAAA,aAAI,EAAC,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC7B,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,EAAE;YACb,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,EAAE;YACf,KAAK,EAAE,EAAE;YACT,iBAAiB,EAAE,EAAE;YACrB,OAAO,EAAE,MAAM;YACf,SAAS,EAAE,EAAE;YACb,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAwB;YACxE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC;YACpD,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,KAAK;YAChB,iBAAiB,EAAE,IAAI,CAAC,2BAA2B;YACnD,iBAAiB,EAAE,IAAI,CAAC,2BAA2B;YACnD,sBAAsB,EAAE;gBACtB,iBAAiB,EAAE,KAAK;gBACxB,kBAAkB,EAAE,KAAK;gBACzB,oBAAoB,EAAE,KAAK;aAC5B;YACD,UAAU,EAAE,EAAE;YACd,qBAAqB,EAAE,CAAC;SACzB,CAAC;QACF,aAAa,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,SAAS,CAAC,CAAC;QACnD,CAAC,C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E,oBAAoB,CAAC,CAAC;IAC9D,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}

View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
@@ -45,6 +49,7 @@ const util = __importStar(require("./util"));
.stub(actionsUtil, "createStatusReportBase")
.resolves({});
sinon.stub(actionsUtil, "sendStatusReport").resolves(true);
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
const gitHubVersion = {
type: util.GitHubVariant.DOTCOM,
};

View File

@@ -1 +1 @@
{"version":3,"file":"analyze-action-env.test.js","sourceRoot":"","sources":["../src/analyze-action-env.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,mDAAqC;AACrC,4DAA8C;AAC9C,mDAIyB;AACzB,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,iCAAiC;AAEjC,IAAA,aAAI,EAAC,8DAA8D,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/E,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,iBAA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C,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC9D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}

View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
@@ -61,6 +65,7 @@ const util = __importStar(require("./util"));
optionalInputStub.withArgs("cleanup-level").returns("none");
optionalInputStub.withArgs("expect-error").returns("false");
sinon.stub(util, "getGitHubVersion").resolves(gitHubVersion);
sinon.stub(actionsUtil, "isAnalyzingDefaultBranch").resolves(true);
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
(0, testing_utils_1.mockFeatureFlagApiEndpoint)(200, {});
process.env["CODEQL_THREADS"] = "1";

View File

@@ -1 +1 @@
{"version":3,"file":"analyze-action-input.test.js","sourceRoot":"","sources":["../src/analyze-action-input.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,mDAAqC;AACrC,4DAA8C;AAC9C,mDAIyB;AACzB,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,iCAAiC;AAEjC,IAAA,aAAI,EAAC,sDAAsD,EAAE,KAAK,EAA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AC,CAAC;QACzD,MAAM,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAElD,uEAAuE;QACvE,oEAAoE;QACpE,4EAA4E;QAC5E,wEAAwE;QACxE,MAAM,aAAa,CAAC,UAAU,CAAC;QAE/B,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC/D,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAC7D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC9D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}

View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
@@ -31,7 +35,7 @@ async function run(uploadSarifDebugArtifact) {
throw new Error("Config file could not be found at expected location. Did the 'init' action fail to start?");
}
// Upload Actions SARIF artifacts for debugging
if (config === null || config === void 0 ? void 0 : config.debugMode) {
if (config?.debugMode) {
core.info("Debug mode is on. Uploading available SARIF files as Actions debugging artifact...");
const outputDir = actionsUtil.getRequiredInput("output");
await uploadSarifDebugArtifact(config, outputDir);

View File

@@ -1 +1 @@
{"version":3,"file":"analyze-action-post-helper.js","sourceRoot":"","sources":["../src/analyze-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAA2C;AAC3C,uCAA6C;AAEtC,KAAK,UAAU,GAAG,CAAC,wBAAkC;IAC1D,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAElC,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,WAAW,CAAC,qBAAqB,EAAE,EAAE,MAAM,CAAC,CAAC;IAC5E,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,CAAC;KACH;IAED,+CAA+C;IAC/C,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,EAAE;QACrB,IAAI,CAAC,IAAI,CACP,oFAAoF,CACrF,CAAC;QACF,MAAM,SAAS,GAAG,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACzD,MAAM,wBAAwB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;KACnD;AACH,CAAC;AAlBD,kBAkBC"}
{"version":3,"file":"analyze-action-post-helper.js","sourceRoot":"","sources":["../src/analyze-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAA2C;AAC3C,uCAA6C;AAEtC,KAAK,UAAU,GAAG,CAAC,wBAAkC;IAC1D,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAElC,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,WAAW,CAAC,qBAAqB,EAAE,EAAE,MAAM,CAAC,CAAC;IAC5E,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,CAAC;KACH;IAED,+CAA+C;IAC/C,IAAI,MAAM,EAAE,SAAS,EAAE;QACrB,IAAI,CAAC,IAAI,CACP,oFAAoF,CACrF,CAAC;QACF,MAAM,SAAS,GAAG,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACzD,MAAM,wBAAwB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;KACnD;AACH,CAAC;AAlBD,kBAkBC"}

View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];

View File

@@ -1 +1 @@
{"version":3,"file":"analyze-action-post-helper.test.js","sourceRoot":"","sources":["../src/analyze-action-post-helper.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,sFAAwE;AACxE,4DAA8C;AAC9C,mDAA6C;AAC7C,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAAA,aAAI,EAAC,0CAA0C,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC3D,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC5C,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC;QAEpC,MAAM,aAAa,GAAuB;YACxC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;SAChC,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC;YAC5C,SAAS,EAAE,KAAK;YAChB,aAAa;YACb,SAAS,E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YACf,aAAa;YACb,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,EAAE;SACuB,CAAC,CAAC;QAEpC,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QACtE,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAEhE,MAAM,cAAc,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;QAEnC,MAAM,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAElD,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}

View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
@@ -27,13 +31,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const analyzeActionPostHelper = __importStar(require("./analyze-action-post-helper"));
const debugArtifacts = __importStar(require("./debug-artifacts"));
const util_1 = require("./util");
async function runWrapper() {
try {
await analyzeActionPostHelper.run(debugArtifacts.uploadSarifDebugArtifact);
}
catch (error) {
core.setFailed(`analyze post-action step failed: ${error}`);
console.log(error);
core.setFailed(`analyze post-action step failed: ${(0, util_1.wrapError)(error).message}`);
}
}
void runWrapper();

View File

@@ -1 +1 @@
{"version":3,"file":"analyze-action-post.js","sourceRoot":"","sources":["../src/analyze-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,oDAAsC;AAEtC,sFAAwE;AACxE,kEAAoD;AAEpD,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;KAC5E;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,oCAAoC,KAAK,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
{"version":3,"file":"analyze-action-post.js","sourceRoot":"","sources":["../src/analyze-action-post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,oDAAsC;AAEtC,sFAAwE;AACxE,kEAAoD;AACpD,iCAAmC;AAEnC,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;KAC5E;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CACZ,oCAAoC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAC/D,CAAC;KACH;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}

73
lib/analyze-action.js generated
View File

@@ -1,7 +1,11 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
@@ -25,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.runPromise = exports.sendStatusReport = void 0;
const fs = __importStar(require("fs"));
const path_1 = __importDefault(require("path"));
// We need to import `performance` on Node 12
const perf_hooks_1 = require("perf_hooks");
const core = __importStar(require("@actions/core"));
const actionsUtil = __importStar(require("./actions-util"));
@@ -39,15 +42,14 @@ const feature_flags_1 = require("./feature-flags");
const languages_1 = require("./languages");
const logging_1 = require("./logging");
const repository_1 = require("./repository");
const shared_environment_1 = require("./shared-environment");
const trap_caching_1 = require("./trap-caching");
const upload_lib = __importStar(require("./upload-lib"));
const util = __importStar(require("./util"));
const util_1 = require("./util");
// eslint-disable-next-line import/no-commonjs
const pkg = require("../package.json");
async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) {
const status = actionsUtil.getActionsStatus(error, stats === null || stats === void 0 ? void 0 : stats.analyze_failure_language);
const statusReportBase = await actionsUtil.createStatusReportBase("finish", status, startedAt, error === null || error === void 0 ? void 0 : error.message, error === null || error === void 0 ? void 0 : error.stack);
const status = actionsUtil.getActionsStatus(error, stats?.analyze_failure_language);
const statusReportBase = await actionsUtil.createStatusReportBase("finish", status, startedAt, error?.message, error?.stack);
const statusReport = {
...statusReportBase,
...(config
@@ -96,37 +98,38 @@ function doesGoExtractionOutputExist(config) {
].some((ext) => fileName.endsWith(ext))));
}
/**
* When Go extraction reconciliation is enabled, either via the feature
* or an environment variable, we will attempt to autobuild Go to preserve
* compatibility for users who have set up Go using a legacy scanning style
* CodeQL workflow, i.e. one without an autobuild step or manual build
* steps.
* We attempt to autobuild Go to preserve compatibility for users who have
* set up Go using a legacy scanning style CodeQL workflow, i.e. one without
* an autobuild step or manual build steps.
*
* - We detect whether an autobuild step is present by checking the
* `util.DID_AUTOBUILD_GO_ENV_VAR_NAME` environment variable, which is set
* `CODEQL_ACTION_DID_AUTOBUILD_GOLANG` environment variable, which is set
* when the autobuilder is invoked.
* - We detect whether the Go database has already been finalized in case it
* has been manually set in a prior Action step.
* - We approximate whether manual build steps are present by looking at
* whether any extraction output already exists for Go.
*/
async function runAutobuildIfLegacyGoWorkflow(config, featureEnablement, logger) {
async function runAutobuildIfLegacyGoWorkflow(config, logger) {
if (!config.languages.includes(languages_1.Language.go)) {
return;
}
if (!(await util.isGoExtractionReconciliationEnabled(featureEnablement))) {
logger.debug("Won't run Go autobuild since Go extraction reconciliation is not enabled.");
if (process.env[shared_environment_1.CODEQL_ACTION_DID_AUTOBUILD_GOLANG] === "true") {
logger.debug("Won't run Go autobuild since it has already been run.");
return;
}
if (process.env[util.DID_AUTOBUILD_GO_ENV_VAR_NAME] === "true") {
// This log line is info level while Go extraction reconciliation is in beta.
// We will make it debug level once Go extraction reconciliation is GA.
logger.info("Won't run Go autobuild since it has already been run.");
if ((0, analyze_1.dbIsFinalized)(config, languages_1.Language.go, logger)) {
logger.debug("Won't run Go autobuild since there is already a finalized database for Go.");
return;
}
// This captures whether a user has added manual build steps for Go
if (doesGoExtractionOutputExist(config)) {
// This log line is info level while Go extraction reconciliation is in beta.
// We will make it debug level once Go extraction reconciliation is GA.
logger.info("Won't run Go autobuild since at least one file of Go code has already been extracted.");
logger.debug("Won't run Go autobuild since at least one file of Go code has already been extracted.");
// If the user has run the manual build step, and has set the `CODEQL_EXTRACTOR_GO_BUILD_TRACING`
// variable, we suggest they remove it from their workflow.
if ("CODEQL_EXTRACTOR_GO_BUILD_TRACING" in process.env) {
logger.warning(`The CODEQL_EXTRACTOR_GO_BUILD_TRACING environment variable has no effect on workflows with manual build steps, so we recommend that you remove it from your workflow.`);
}
return;
}
await (0, autobuild_1.runAutobuild)(languages_1.Language.go, config, logger);
@@ -139,8 +142,7 @@ async function run() {
let trapCacheUploadTime = undefined;
let dbCreationTimings = undefined;
let didUploadTrapCaches = false;
util.initializeEnvironment(util.Mode.actions, pkg.version);
await util.checkActionVersion(pkg.version);
util.initializeEnvironment(actionsUtil.getActionVersion());
const logger = (0, logging_1.getActionsLogger)();
try {
if (!(await actionsUtil.sendStatusReport(await actionsUtil.createStatusReportBase("finish", "starting", startedAt)))) {
@@ -153,15 +155,14 @@ async function run() {
if (hasBadExpectErrorInput()) {
throw new Error("`expect-error` input parameter is for internal use only. It should only be set by codeql-action or a fork.");
}
await util.enrichEnvironment(util.Mode.actions, await (0, codeql_1.getCodeQL)(config.codeQLCmd));
const apiDetails = (0, api_client_1.getApiDetails)();
const outputDir = actionsUtil.getRequiredInput("output");
const threads = util.getThreadsFlag(actionsUtil.getOptionalInput("threads") || process.env["CODEQL_THREADS"], logger);
const memory = util.getMemoryFlag(actionsUtil.getOptionalInput("ram") || process.env["CODEQL_RAM"]);
const repositoryNwo = (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY"));
const gitHubVersion = await (0, api_client_1.getGitHubVersionActionsOnly)();
const features = new feature_flags_1.Features(gitHubVersion, apiDetails, repositoryNwo, logger);
await runAutobuildIfLegacyGoWorkflow(config, features, logger);
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), logger);
await runAutobuildIfLegacyGoWorkflow(config, logger);
dbCreationTimings = await (0, analyze_1.runFinalize)(outputDir, threads, memory, config, logger, features);
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
runStats = await (0, analyze_1.runQueries)(outputDir, memory, util.getAddSnippetsFlag(actionsUtil.getRequiredInput("add-snippets")), threads, actionsUtil.getOptionalInput("category"), config, logger, features);
@@ -174,8 +175,9 @@ async function run() {
dbLocations[language] = util.getCodeQLDatabasePath(config, language);
}
core.setOutput("db-locations", dbLocations);
if (runStats && actionsUtil.getRequiredInput("upload") === "true") {
uploadResult = await upload_lib.uploadFromActions(outputDir, config.gitHubVersion, apiDetails, logger);
const uploadInput = actionsUtil.getOptionalInput("upload");
if (runStats && actionsUtil.getUploadValue(uploadInput) === "always") {
uploadResult = await upload_lib.uploadFromActions(outputDir, actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger);
core.setOutput("sarif-id", uploadResult.sarifID);
}
else {
@@ -194,20 +196,20 @@ async function run() {
}
else if (uploadResult !== undefined &&
actionsUtil.getRequiredInput("wait-for-processing") === "true") {
await upload_lib.waitForProcessing((0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY")), uploadResult.sarifID, apiDetails, (0, logging_1.getActionsLogger)());
await upload_lib.waitForProcessing((0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY")), uploadResult.sarifID, (0, logging_1.getActionsLogger)());
}
// If we did not throw an error yet here, but we expect one, throw it.
if (actionsUtil.getOptionalInput("expect-error") === "true") {
core.setFailed(`expect-error input was set to true but no error was thrown.`);
}
core.exportVariable(shared_environment_1.CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true");
}
catch (origError) {
const error = origError instanceof Error ? origError : new Error(String(origError));
catch (unwrappedError) {
const error = (0, util_1.wrapError)(unwrappedError);
if (actionsUtil.getOptionalInput("expect-error") !== "true" ||
hasBadExpectErrorInput()) {
core.setFailed(error.message);
}
console.log(error);
if (error instanceof analyze_1.CodeQLAnalysisError) {
const stats = { ...error.queriesStatusReport };
await sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger);
@@ -236,8 +238,7 @@ async function runWrapper() {
await exports.runPromise;
}
catch (error) {
core.setFailed(`analyze action failed: ${error}`);
console.log(error);
core.setFailed(`analyze action failed: ${(0, util_1.wrapError)(error).message}`);
}
await (0, util_1.checkForTimeout)();
}

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More