You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/review-template.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
-[ ] I've worked through build failures and tests are passing.
6
6
-[ ] For REST API content, I've verified that endpoints, parameters, and responses are correct and work as expected and provided curl samples below.
7
7
8
-
For more information, check out our [full review guidelines and checklist](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/reviews-and-feedback/review-process.md).
8
+
For more information, check out our [full review guidelines and checklist](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/reviews-and-feedback/review-process.md).
Copy file name to clipboardExpand all lines: content/actions/guides/creating-postgresql-service-containers.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ topics:
22
22
23
23
### Introduction
24
24
25
-
This guide shows you workflow examples that configure a service container using the Docker Hub `postgres` image. The workflow runs a script to create a PostgreSQL client and populate the client with data. To test that the workflow creates and populates the PostgreSQL client, the script prints the client's data to the console.
25
+
This guide shows you workflow examples that configure a service container using the Docker Hub `postgres` image. The workflow runs a script that connects to the PostgreSQL service, creates a table, and then populates it with data. To test that the workflow creates and populates the PostgreSQL table, the script prints the data from the table to the console.
26
26
27
27
{% data reusables.github-actions.docker-container-os-support %}
28
28
@@ -81,10 +81,10 @@ jobs:
81
81
run: npm ci
82
82
83
83
- name: Connect to PostgreSQL
84
-
# Runs a script that creates a PostgreSQL client, populates
85
-
# the client with data, and retrieves data
84
+
# Runs a script that creates a PostgreSQL table, populates
85
+
# the table with data, and then retrieves the data.
86
86
run: node client.js
87
-
# Environment variable used by the `client.js` script to create a new PostgreSQL client.
87
+
# Environment variables used by the `client.js` script to create a new PostgreSQL table.
88
88
env:
89
89
# The hostname used to communicate with the PostgreSQL service container
90
90
POSTGRES_HOST: postgres
@@ -141,8 +141,8 @@ steps:
141
141
run: npm ci
142
142
143
143
- name: Connect to PostgreSQL
144
-
# Runs a script that creates a PostgreSQL client, populates
145
-
# the client with data, and retrieves data
144
+
# Runs a script that creates a PostgreSQL table, populates
145
+
# the table with data, and then retrieves the data.
146
146
run: node client.js
147
147
# Environment variable used by the `client.js` script to create
148
148
# a new PostgreSQL client.
@@ -204,11 +204,11 @@ jobs:
204
204
run: npm ci
205
205
206
206
- name: Connect to PostgreSQL
207
-
# Runs a script that creates a PostgreSQL client, populates
208
-
# the client with data, and retrieves data
207
+
# Runs a script that creates a PostgreSQL table, populates
208
+
# the table with data, and then retrieves the data
209
209
run: node client.js
210
-
# Environment variable used by the `client.js` script to create
211
-
# a new PostgreSQL client.
210
+
# Environment variables used by the `client.js` script to create
211
+
# a new PostgreSQL table.
212
212
env:
213
213
# The hostname used to communicate with the PostgreSQL service container
214
214
POSTGRES_HOST: localhost
@@ -268,11 +268,11 @@ steps:
268
268
run: npm ci
269
269
270
270
- name: Connect to PostgreSQL
271
-
# Runs a script that creates a PostgreSQL client, populates
272
-
# the client with data, and retrieves data
271
+
# Runs a script that creates a PostgreSQL table, populates
272
+
# the table with data, and then retrieves the data
273
273
run: node client.js
274
-
# Environment variable used by the `client.js` script to create
275
-
# a new PostgreSQL client.
274
+
# Environment variables used by the `client.js` script to create
275
+
# a new PostgreSQL table.
276
276
env:
277
277
# The hostname used to communicate with the PostgreSQL service container
278
278
POSTGRES_HOST: localhost
@@ -286,9 +286,9 @@ steps:
286
286
287
287
### Testing the PostgreSQL service container
288
288
289
-
You can test your workflow using the following script, which creates a PostgreSQL client and adds a new table with some placeholder data. The script then prints the values stored in the PostgreSQL client to the terminal. Your script can use any language you'd like, but this example uses Node.js and the `pg` npm module. For more information, see the [npm pg module](https://www.npmjs.com/package/pg).
289
+
You can test your workflow using the following script, which connects to the PostgreSQL service and adds a new table with some placeholder data. The script then prints the values stored in the PostgreSQL table to the terminal. Your script can use any language you'd like, but this example uses Node.js and the `pg` npm module. For more information, see the [npm pg module](https://www.npmjs.com/package/pg).
290
290
291
-
You can modify *client.js* to include any PostgreSQL operations needed by your workflow. In this example, the script creates the PostgreSQL client instance, creates a table, adds placeholder data, then retrieves the data.
291
+
You can modify *client.js* to include any PostgreSQL operations needed by your workflow. In this example, the script connects to the PostgreSQL service, adds a table to the `postgres` database, inserts some placeholder data, and then retrieves the data.
292
292
293
293
{% data reusables.github-actions.service-container-add-script %}
The script creates a new PostgreSQL `Client`, which accepts a `host`and `port` parameter. The script uses the `POSTGRES_HOST` and `POSTGRES_PORT` environment variables to set the client's IP address and port. If `host` and `port` are not defined, the default host is `localhost` and the default port is 5432.
327
+
The script creates a new connection to the PostgreSQL service, and uses the `POSTGRES_HOST` and `POSTGRES_PORT` environment variables to specify the PostgreSQL service IP address and port. If `host` and `port` are not defined, the default host is `localhost` and the default port is 5432.
328
328
329
-
The script creates a table and populates it with placeholder data. To test that the PostgreSQL database contains the data, the script prints the contents of the table to the console log.
329
+
The script creates a table and populates it with placeholder data. To test that the `postgres` database contains the data, the script prints the contents of the table to the console log.
330
330
331
-
When you run this workflow, you should see the following output in the "Connect to PostgreSQL" step confirming you created the PostgreSQL client and added data:
331
+
When you run this workflow, you should see the following output in the "Connect to PostgreSQL" step, which confirms that you successfully created the PostgreSQL table and added data:
Copy file name to clipboardExpand all lines: content/code-security/secure-coding/about-codeql-code-scanning-in-your-ci-system.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,10 +38,13 @@ Use the {% data variables.product.prodname_codeql_cli %} to analyze:
38
38
39
39
For more information, see "[Running {% data variables.product.prodname_codeql_cli %} in your CI system](/code-security/secure-coding/running-codeql-cli-in-your-ci-system)."
40
40
41
+
{% if currentVersion == "free-pro-team@latest" %}
42
+
If you need to set up the CI system to orchestrate compiler invocations as well as running {% data variables.product.prodname_codeql %} analysis, you must use the {% data variables.product.prodname_codeql_runner %}.
43
+
{% else %}
41
44
You will need to use the {% data variables.product.prodname_codeql_runner %} if you need to:
42
-
43
45
- Set up the CI system to orchestrate compiler invocations as well as running {% data variables.product.prodname_codeql %} analysis.
44
46
- Analyze more than one language in a repository.
47
+
{% endif %}
45
48
46
49
{% data reusables.code-scanning.beta-codeql-runner %}
47
50
@@ -57,4 +60,3 @@ You add the {% data variables.product.prodname_codeql_runner %} to your third-pa
57
60
58
61
To set up code scanning in your CI system, see "[Running {% data variables.product.prodname_codeql_runner %} in your CI system](/code-security/secure-coding/running-codeql-runner-in-your-ci-system)."
Copy file name to clipboardExpand all lines: content/code-security/secure-coding/configuring-code-scanning.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,35 @@ jobs:
223
223
```
224
224
{% endif %}
225
225
226
+
{% if currentVersion == "free-pro-team@latest" %}
227
+
### Configuring a category for the analysis
228
+
229
+
Use `category` to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. The category you specify in your workflow will be included in the SARIF results file.
230
+
231
+
This parameter is particularly useful if you work with monorepos and have multiple SARIF files for different components of the monorepo.
232
+
233
+
{% raw %}
234
+
``` yaml
235
+
- name: Perform CodeQL Analysis
236
+
uses: github/codeql-action/analyze
237
+
with:
238
+
# Optional. Specify a category to distinguish between multiple analyses
239
+
# for the same tool and ref. If you don't use `category` in your workflow,
240
+
# GitHub will generate a default category name for you
241
+
category: "my_category"
242
+
```
243
+
{% endraw %}
244
+
245
+
If you don't specify a `category` parameter in your workflow, {% data variables.product.prodname_dotcom %} will generate a category name for you, based on the name of the workflow file triggering the action, the action name, and any matrix variables. For example:
246
+
- The `.github/workflows/codeql-analysis.yml` workflow and the `analyze` action will produce the category `.github/workflows/codeql.yml:analyze`.
247
+
- The `.github/workflows/codeql-analysis.yml` workflow, the `analyze` action, and the `{language: javascript, os: linux}` matrix variables will produce the category `.github/workflows/codeql-analysis.yml:analyze/language:javascript/os:linux`.
248
+
249
+
The `category` value will appear as the `<run>.automationDetails.id` property in SARIF v2.1.0. For more information, see "[SARIF support for {% data variables.product.prodname_code_scanning %}](/code-security/secure-coding/sarif-support-for-code-scanning#runautomationdetails-object)."
250
+
251
+
Your specified category will not overwrite the details of the `runAutomationDetails` object in the SARIF file, if included.
252
+
253
+
{% endif %}
254
+
226
255
### Running additional queries
227
256
228
257
{% data reusables.code-scanning.run-additional-queries %}
Copy file name to clipboardExpand all lines: content/code-security/secure-coding/configuring-codeql-runner-in-your-ci-system.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,7 +174,8 @@ Analyzes the code in the {% data variables.product.prodname_codeql %} databases
174
174
|`--no-upload`|| None. Stops the {% data variables.product.prodname_codeql_runner %} from uploading the results to {% data variables.product.product_name %}. |
175
175
|`--output-dir`|| Directory where the output SARIF files are stored. The default is in the directory of temporary files. |
176
176
|`--ram`|| Amount of memory to use when running queries. The default is to use all available memory. |
177
-
| <nobr>`--no-add-snippets`</nobr> || None. Excludes code snippets from the SARIF output. |
177
+
| <nobr>`--no-add-snippets`</nobr> | | None. Excludes code snippets from the SARIF output. |{% if currentVersion == "free-pro-team@latest" %}
178
+
| <nobr>`--category`<nobr> | | Category to include in the SARIF results file for this analysis. A category can be used to distinguish multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. This value will appear in the `<run>.automationDetails.id` property in SARIF v2.1.0. |{% endif %}
178
179
|`--threads`|| Number of threads to use when running queries. The default is to use all available cores. |
179
180
|`--temp-dir`|| Directory where temporary files are stored. The default is `./codeql-runner`. |
Copy file name to clipboardExpand all lines: content/code-security/secure-coding/running-codeql-cli-in-your-ci-system.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,7 +150,8 @@ For more information and examples, see [Creating {% data variables.product.prodn
150
150
|`<database>`| {% octicon "check-circle-fill" aria-label="Required" %} | Specify the path for the directory that contains the {% data variables.product.prodname_codeql %} database to analyze. |
151
151
|`<queries>`| {% octicon "check-circle-fill" aria-label="Required" %} | Specify the queries to run. To run the standard queries used for{% data variables.product.prodname_code_scanning %}, use: `<language>-code-scanning.qls` where `<language>` is the short code for the language of the database. To see the other query suites includedin the {% data variables.product.prodname_codeql_cli %} bundle look in`/extraction-root/codeql/qlpacks/codeql-<language>/codeql-suites`. For information about creating your own query suite, see [Creating CodeQL query suites](https://codeql.github.com/docs/codeql-cli/creating-codeql-query-suites/) in the documentation for the {% data variables.product.prodname_codeql_cli %}.
152
152
|<nobr>`--format`</nobr>| {% octicon "check-circle-fill" aria-label="Required" %} | Specify the format for the results file generated by the command. For upload to {% data variables.product.company_short %} this should be: {% if currentVersion == "free-pro-team@latest" %}`sarif-latest`{% else %}`sarifv2.1.0`{% endif %}. For more information, see "[SARIF support for {% data variables.product.prodname_code_scanning %}](/code-security/secure-coding/sarif-support-for-code-scanning)."
153
-
|<nobr>`--output`</nobr>| {% octicon "check-circle-fill" aria-label="Required" %} | Specify where to save the SARIF results file.
153
+
|<nobr>`--output`</nobr>| {% octicon "check-circle-fill" aria-label="Required" %} | Specify where to save the SARIF results file.{% if currentVersion == "free-pro-team@latest" %}
154
+
|<nobr>`--sarif-category`<nobr>|| Optional. Specify a category to include in the SARIF results file forthis analysis. A category can be used to distinguish multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. This value will appearin the `<run>.automationId` property in SARIF v1, the `<run>.automationLogicalId` property in SARIF v2, and the `<run>.automationDetails.id` property in SARIF v2.1.0. |{% endif %}
154
155
|<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`.
155
156
156
157
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/) in the documentation for the {% data variables.product.prodname_codeql_cli %}.
0 commit comments