Skip to content

Commit 2877a01

Browse files
authored
Merge branch 'main' into patch-2
2 parents 9a0cb72 + f22f4f5 commit 2877a01

File tree

102 files changed

+17742
-11419
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+17742
-11419
lines changed

.github/actions-scripts/content-changes-table-comment.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const octokit = github.getOctokit(GITHUB_TOKEN)
2525
const response = await octokit.rest.repos.compareCommitsWithBasehead({
2626
owner: context.repo.owner,
2727
repo: context.payload.repository.name,
28-
basehead: `${context.payload.pull_request.base.ref}...${context.payload.pull_request.head.ref}`,
28+
basehead: `${context.payload.pull_request.base.sha}...${context.payload.pull_request.head.sha}`,
2929
})
3030

3131
const { files } = response.data
@@ -47,7 +47,7 @@ for (const file of articleFiles) {
4747
const fileContents = await getContents(
4848
context.repo.owner,
4949
context.payload.repository.name,
50-
context.payload.pull_request.head.ref,
50+
context.payload.pull_request.head.sha,
5151
file.filename
5252
)
5353

@@ -82,9 +82,9 @@ for (const file of articleFiles) {
8282
previewCell += `${version}@ `
8383
prodCell += `${version}@ `
8484

85-
currentApplicableVersions.forEach((version) => {
86-
previewCell += `[${version.split('@')[1]}](${APP_URL}/${version}/${fileUrl}) `
87-
prodCell += `[${version.split('@')[1]}](${PROD_URL}/${version}/${fileUrl}) `
85+
currentApplicableVersions.forEach((ghesVersion) => {
86+
previewCell += `[${ghesVersion.split('@')[1]}](${APP_URL}/${ghesVersion}/${fileUrl}) `
87+
prodCell += `[${ghesVersion.split('@')[1]}](${PROD_URL}/${ghesVersion}/${fileUrl}) `
8888
})
8989
previewCell += '<br>'
9090
prodCell += '<br>'
Loading
Loading

components/rest/ParameterRow.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function ParameterRow({
2121
description,
2222
isRequired,
2323
defaultValue,
24-
// enumValues, //waiting on github #218747 to merge before adding enum support
24+
enumValues,
2525
slug,
2626
childParamsGroups = null,
2727
numPreviews = 0,
@@ -61,8 +61,7 @@ export function ParameterRow({
6161
<code>{defaultValue.toString()}</code>
6262
</p>
6363
)}
64-
{/* waiting on github #218747 to merge before adding enum support */}
65-
{/* {enumValues && (
64+
{enumValues && (
6665
<p>
6766
<span>{t('rest.reference.enum_description_title')}: </span>
6867

@@ -78,7 +77,7 @@ export function ParameterRow({
7877
)
7978
})}
8079
</p>
81-
)} */}
80+
)}
8281
</div>
8382
</div>
8483
</td>

components/rest/RestOperation.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ export function RestOperation({ operation }: Props) {
3232
<a href={`#${slug}`}>{operation.title}</a>
3333
</h2>
3434
{operation.enabledForGitHubApps && (
35-
<>
36-
<span className="mr-2">
37-
<CheckCircleFillIcon size={18} />
35+
<div className="d-flex">
36+
<span className="mr-2 d-flex flex-items-center">
37+
<CheckCircleFillIcon size={16} />
3838
</span>
3939
<span>
4040
{t('rest.reference.works_with') + ' '}
4141
<Link className="" href={`/${router.locale}/developers/apps`}>
4242
GitHub Apps
4343
</Link>
4444
</span>
45-
</>
45+
</div>
4646
)}
4747
<div className={cx(styles.restOperation, 'd-flex flex-wrap gutter mt-4')}>
4848
<div className="col-md-12 col-lg-6">

content/admin/configuration/configuring-your-enterprise/site-admin-dashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ You can see the number of active committers that are currently using seats for {
193193

194194
Under "Current active committer count", you can see the number of active committers for repositories with {% data variables.product.prodname_GH_advanced_security %} enabled. This is the number of licensed seats that are currently being used.
195195

196-
Under "Maximum committers across across entire instance", you can see the number of active committers across all the repositories in your enterprise. This is the number of seats that would be used if you enabled {% data variables.product.prodname_GH_advanced_security %} for every repository in your enterprise.
196+
Under "Maximum committers across entire instance", you can see the number of active committers across all the repositories in your enterprise. This is the number of seats that would be used if you enabled {% data variables.product.prodname_GH_advanced_security %} for every repository in your enterprise.
197197

198198
Under "Calculate Additional Advanced Committers", you can calculate how many more additional seats will be used if you enable {% data variables.product.prodname_GH_advanced_security %} for specific organizations and repositories. Under "Organizations and Repositories", enter or paste a list of organizations and repositories, with one organization or repository per line.
199199

content/admin/overview/creating-an-enterprise-account.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ An enterprise account is included in {% data variables.product.prodname_ghe_clou
2222

2323
When you create an enterprise account, your existing organization will automatically be owned by the enterprise account. All current owners of your organization will become owners of the enterprise account. All current billing managers of the organization will become billing managers of the new enterprise account. The current billing details of the organization, including the organization's billing email address, will become billing details of the new enterprise account.
2424

25+
If the organization is connected to {% data variables.product.prodname_ghe_server %} or {% data variables.product.prodname_ghe_managed %} via {% data variables.product.prodname_github_connect %}, upgrading the organization to an enterprise account **will not** update the connection. If you want to connect to the new enterprise account, you must disable and re-enable {% data variables.product.prodname_github_connect %}.
26+
27+
- "[Managing {% data variables.product.prodname_github_connect %}](/enterprise-server@latest/admin/configuration/configuring-github-connect/managing-github-connect)" in the {% data variables.product.prodname_ghe_server %} documentation
28+
- "[Managing {% data variables.product.prodname_github_connect %}](/github-ae@latest/admin/configuration/configuring-github-connect/managing-github-connect)" in the {% data variables.product.prodname_ghe_managed %} documentation
29+
2530
## Creating an enterprise account on {% data variables.product.prodname_dotcom %}
2631

2732
To create an enterprise account on {% data variables.product.prodname_dotcom %}, your organization must be using {% data variables.product.prodname_ghe_cloud %} and paying by invoice.

content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system.md

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ You can display the command-line help for any command using the <nobr>`--help`</
6161
- For a pull request, check out either the head commit of the pull request, or check out a {% data variables.product.prodname_dotcom %}-generated merge commit of the pull request.
6262
2. Set up the environment for the codebase, making sure that any dependencies are available. For more information, see [Creating databases for non-compiled languages](https://codeql.github.com/docs/codeql-cli/creating-codeql-databases/#creating-databases-for-non-compiled-languages) and [Creating databases for compiled languages](https://codeql.github.com/docs/codeql-cli/creating-codeql-databases/#creating-databases-for-compiled-languages) in the documentation for the {% data variables.product.prodname_codeql_cli %}.
6363
3. Find the build command, if any, for the codebase. Typically this is available in a configuration file in the CI system.
64-
4. Run `codeql database create` from the checkout root of your repository and build the codebase.
64+
4. Run `codeql database create` from the checkout root of your repository and build the codebase.
6565
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
6666
```shell
6767
# Single supported language - create one CodeQL databsae
68-
codeql database create &lt;database&gt; --command&lt;build&gt; --language=&lt;language-identifier&gt;
68+
codeql database create &lt;database&gt; --command&lt;build&gt; --language=&lt;language-identifier&gt;
6969

7070
# Multiple supported languages - create one CodeQL database per language
7171
codeql database create &lt;database&gt; --command&lt;build&gt; \
72-
--db-cluster --language=&lt;language-identifier&gt;,&lt;language-identifier&gt;
72+
--db-cluster --language=&lt;language-identifier&gt;,&lt;language-identifier&gt;
7373
```
7474
{% else %}
7575
```shell
@@ -106,7 +106,7 @@ $ codeql database create /codeql-dbs/example-repo --language=javascript \
106106
in /checkouts/example-repo.
107107
> [build-stdout] Single-threaded extraction.
108108
> [build-stdout] Extracting
109-
...
109+
...
110110
> Finalizing database at /codeql-dbs/example-repo.
111111
> Successfully created database at /codeql-dbs/example-repo.
112112
```
@@ -146,16 +146,11 @@ $
146146
147147
## Analyzing a {% data variables.product.prodname_codeql %} database
148148
149-
1. Create a {% data variables.product.prodname_codeql %} database (see above).{% if codeql-packs %}
150-
2. Optional, run `codeql pack download` to download any {% data variables.product.prodname_codeql %} packs (beta) that you want to run during analysis. For more information, see "[Downloading and using {% data variables.product.prodname_codeql %} query packs](#downloading-and-using-codeql-query-packs)" below.
151-
```shell
152-
codeql pack download &lt;packs&gt;
153-
```
154-
{% endif %}
155-
3. Run `codeql database analyze` on the database and specify which {% if codeql-packs %}packs and/or {% endif %}queries to use.
149+
1. Create a {% data variables.product.prodname_codeql %} database (see above).
150+
2. Run `codeql database analyze` on the database and specify which {% if codeql-packs %}packs and/or {% endif %}queries to use.
156151
```shell
157152
codeql database analyze &lt;database&gt; --format=&lt;format&gt; \
158-
--output=&lt;output&gt; {% if codeql-packs %}&lt;packs,queries&gt;{% else %} &lt;queries&gt;{% endif %}
153+
--output=&lt;output&gt; {% if codeql-packs %}--download &lt;packs,queries&gt;{% else %}&lt;queries&gt;{% endif %}
159154
```
160155

161156
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
@@ -179,7 +174,8 @@ codeql database analyze &lt;database&gt; --format=&lt;format&gt; \
179174
| <nobr>`--output`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify where to save the SARIF results file.{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
180175
| <nobr>`--sarif-category`<nobr> | {% octicon "question" aria-label="Required with multiple results sets" %} | Optional for single database analysis. Required to define the language when you analyze multiple databases for a single commit in a repository. Specify a category to include in the SARIF results file for this analysis. A category is used to distinguish multiple analyses for the same tool and commit, but performed on different languages or different parts of the code.|{% endif %}{% ifversion fpt or ghes > 3.3 or ghae or ghec %}
181176
| <nobr>`--sarif-add-query-help`</nobr> | | Optional. Use if you want to include any available markdown-rendered query help for custom queries used in your analysis. Any query help for custom queries included in the SARIF output will be displayed in the code scanning UI if the relevant query generates an alert. For more information, see [Analyzing databases with the {% data variables.product.prodname_codeql_cli %}](https://codeql.github.com/docs/codeql-cli/analyzing-databases-with-the-codeql-cli/#including-query-help-for-custom-codeql-queries-in-sarif-files) in the documentation for the {% data variables.product.prodname_codeql_cli %}.{% endif %}{% if codeql-packs %}
182-
| `<packs>` | | Optional. Use if you have downloaded CodeQL query packs and want to run the default queries or query suites specified in the packs. For more information, see "[Downloading and using {% data variables.product.prodname_codeql %} packs](#downloading-and-using-codeql-query-packs)."{% endif %}
177+
| `<packs>` | | Optional. Use if you want to include CodeQL query packs in your analysis. For more information, see "[Downloading and using {% data variables.product.prodname_codeql %} packs](#downloading-and-using-codeql-query-packs)."
178+
| <nobr>`--download`</nobr> | | Optional. Use if some of your CodeQL query packs are not yet on disk and need to be downloaded before running queries.{% endif %}
183179
| <nobr>`--threads`</nobr> | | Optional. Use if you want to use more than one thread to run queries. The default value is `1`. You can specify more threads to speed up query execution. To set the number of threads to the number of logical processors, specify `0`.
184180
| <nobr>`--verbose`</nobr> | | Optional. Use to get more detailed information about the analysis process{% ifversion fpt or ghes > 3.1 or ghae or ghec %} and diagnostic data from the database creation process{% endif %}.
185181
@@ -192,13 +188,12 @@ This example analyzes a {% data variables.product.prodname_codeql %} database st
192188
193189
```
194190
$ codeql database analyze /codeql-dbs/example-repo \
195-
javascript-code-scanning.qls {% ifversion fpt or ghes > 3.1 or ghae or ghec %}--sarif-category=javascript{% endif %}
191+
javascript-code-scanning.qls {% ifversion fpt or ghes > 3.1 or ghae or ghec %}--sarif-category=javascript \{% endif %}
196192
--format={% ifversion fpt or ghae or ghec %}sarif-latest{% else %}sarifv2.1.0{% endif %} --output=/temp/example-repo-js.sarif
197193
198194
> Running queries.
199-
> Compiling query plan for /codeql-home/codeql/qlpacks/
200-
codeql-javascript/AngularJS/DisablingSce.ql.
201-
...
195+
> Compiling query plan for /codeql-home/codeql/qlpacks/codeql-javascript/AngularJS/DisablingSce.ql.
196+
...
202197
> Shutting down query evaluator.
203198
> Interpreting results.
204199
```
@@ -251,38 +246,50 @@ There is no output from this command unless the upload was unsuccessful. The com
251246
252247
The {% data variables.product.prodname_codeql_cli %} bundle includes queries that are maintained by {% data variables.product.company_short %} experts, security researchers, and community contributors. If you want to run queries developed by other organizations, {% data variables.product.prodname_codeql %} query packs provide an efficient and reliable way to download and run queries. For more information, see "[About code scanning with CodeQL](/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql#about-codeql-queries)."
253248
254-
Before you can use a {% data variables.product.prodname_codeql %} pack to analyze a database, you must download any packages you require from the {% data variables.product.company_short %} {% data variables.product.prodname_container_registry %} by running `codeql pack download` and specifying the packages you want to download. If a package is not publicly available, you will need to use a {% data variables.product.prodname_github_app %} or personal access token to authenticate. For more information and an example, see "[Uploading results to {% data variables.product.product_name %}](#uploading-results-to-github)" above.
255-
256-
```shell
257-
codeql pack download &lt;scope/name@version&gt;,...
258-
```
249+
Before you can use a {% data variables.product.prodname_codeql %} pack to analyze a database, you must download any packages you require from the {% data variables.product.company_short %} {% data variables.product.prodname_container_registry %}. This can be done either by using the `--download` flag as part of the `codeql database analyze` command. If a package is not publicly available, you will need to use a {% data variables.product.prodname_github_app %} or personal access token to authenticate. For more information and an example, see "[Uploading results to {% data variables.product.product_name %}](#uploading-results-to-github)" above.
259250
260251
| Option | Required | Usage |
261252
|--------|:--------:|-----|
262-
| <nobr>`<scope/name@version>`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the scope and name of one or more CodeQL query packs to download using a comma-separated list. Optionally, include the version to download and unzip. By default the latest version of this pack is downloaded. |
253+
| <nobr>`<scope/name@version:path>`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the scope and name of one or more CodeQL query packs to download using a comma-separated list. Optionally, include the version to download and unzip. By default the latest version of this pack is downloaded. Optionally, include a path to a query, directory, or query suite to run. If no path is included, then run the default queries of this pack. |
263254
| <nobr>`--github-auth-stdin`</nobr> | | Optional. Pass the {% data variables.product.prodname_github_app %} or personal access token created for authentication with {% data variables.product.company_short %}'s REST API to the CLI via standard input. This is not needed if the command has access to a `GITHUB_TOKEN` environment variable set with this token.
264255
265256
### Basic example
266257
267-
This example runs two commands to download the latest version of the `octo-org/security-queries` pack and then analyze the database `/codeql-dbs/example-repo`.
258+
This example runs the `codeql database analyze` command with the `--download` option to:
259+
260+
1. Download the latest version of the `octo-org/security-queries` pack.
261+
2. Download a version of the `octo-org/optional-security-queries` pack that is *compatible* with version 1.0.1 (in this case, it is version 1.0.2). For more information on semver compatibility, see [npm's semantic version range documentation](https://github.com/npm/node-semver#ranges).
262+
3. Run all the default queries in `octo-org/security-queries`.
263+
4. Run only the query `queries/csrf.ql` from `octo-org/optional-security-queries`
268264
269265
```
270-
$ echo $OCTO-ORG_ACCESS_TOKEN | codeql pack download octo-org/security-queries
266+
$ echo $OCTO-ORG_ACCESS_TOKEN | codeql database analyze --download /codeql-dbs/example-repo \
267+
octo-org/security-queries \
268+
octo-org/optional-security-queries@~1.0.1:queries/csrf.ql \
269+
--format=sarif-latest --output=/temp/example-repo-js.sarif
271270
272271
> Download location: /Users/mona/.codeql/packages
273272
> Installed fresh octo-org/[email protected]
274-
275-
$ codeql database analyze /codeql-dbs/example-repo octo-org/security-queries \
276-
--format=sarif-latest --output=/temp/example-repo-js.sarif
277-
273+
> Installed fresh octo-org/[email protected]
278274
> Running queries.
279275
> Compiling query plan for /Users/mona/.codeql/packages/octo-org/security-queries/1.0.0/potential-sql-injection.ql.
280-
> [1/1] Found in cache: /Users/mona/.codeql/packages/octo-org/security-queries/1.0.0/potential-sql-injection.ql.
276+
> [1/2] Found in cache: /Users/mona/.codeql/packages/octo-org/security-queries/1.0.0/potential-sql-injection.ql.
281277
> Starting evaluation of octo-org/security-queries/query1.ql.
282-
> [1/1 eval 394ms] Evaluation done; writing results to docto-org/security-queries/query1.bqrs.
278+
> Compiling query plan for /Users/mona/.codeql/packages/octo-org/optional-security-queries/1.0.2/queries/csrf.ql.
279+
> [2/2] Found in cache: /Users/mona/.codeql/packages/octo-org/optional-security-queries/1.0.2/queries/csrf.ql.
280+
> Starting evaluation of octo-org/optional-security-queries/queries/csrf.ql.
281+
> [2/2 eval 694ms] Evaluation done; writing results to octo-org/security-queries/query1.bqrs.
283282
> Shutting down query evaluator.
284283
> Interpreting results.
285284
```
285+
286+
### Direct download of {% data variables.product.prodname_codeql %} packs
287+
288+
If you want to download a {% data variables.product.prodname_codeql %} pack without running it immediately, then you can use the `codeql pack download` command. This is useful if you want to avoid accessing the internet when running {% data variables.product.prodname_codeql %} queries. When you run the {% data variables.product.prodname_codeql %} analysis, you can specify packs, versions, and paths in the same way as in the previous example:
289+
290+
```shell
291+
echo $OCTO-ORG_ACCESS_TOKEN | codeql pack download &lt;scope/name@version:path&gt; &lt;scope/name@version:path&gt; ...
292+
```
286293
{% endif %}
287294
288295
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}

0 commit comments

Comments
 (0)