-
Notifications
You must be signed in to change notification settings - Fork 60k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update secret-scanning pipeline (#52146)
- Loading branch information
Showing
5 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,7 @@ jobs: | |
- release-notes | ||
- rest | ||
- search | ||
- secret-scanning | ||
- shielding | ||
- tracking | ||
# - tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
# Secret scanning | ||
|
||
The files in the secret scanning folder support our secret scanning informational pages. | ||
This secret scanning pipeline automates a table displayed on the [Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets) page. | ||
|
||
Each day a workflow checks if the [data](src/secret-scanning/data/public-docs.yml) is up-to-date. When there are changes, the workflow automatically creates a pull request to update the `src/secret-scanning/data/public-docs.yml` file. The workflow runs `npm run sync-secret-scanning` to check for updates. | ||
|
||
This pipeline uses middleware to check if the path of the URL matches the page that contains the table. The middleware decorates the context with the data, which is displayed on the page using a Markdown table and Liquid. For example: | ||
|
||
```markdown | ||
<!-- FPT version of table --> | ||
{% ifversion fpt %} | ||
|
||
| Provider | Token | Partner | User | Push protection | ||
|----|:----|:----:|:----:|:----:| | ||
{%- for entry in secretScanningData %} | ||
| {{ entry.provider }} | {{ entry.secretType }} | {% if entry.isPublic %}{% octicon "check" aria-label="Supported" %}{% else %}{% octicon "x" aria-label="Unsupported" %}{% endif %} | {% if entry.isPrivateWithGhas %}{% octicon "check" aria-label="Supported" %}{% else %}{% octicon "x" aria-label="Unsupported" %}{% endif %} | {% if entry.hasPushProtection %}{% octicon "check" aria-label="Supported" %}{% else %}{% octicon "x" aria-label="Unsupported" %}{% endif %} | | ||
{%- endfor %} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"sha": "bb86a15b48fe62030cf0ad8c38520508063ec20b", | ||
"blob-sha": "96de8d829b93d371162f193a68ea19ae86ac0d09" | ||
"blob-sha": "96de8d829b93d371162f193a68ea19ae86ac0d09", | ||
"targetFilename": "code-security/secret-scanning/introduction/supported-secret-scanning-patterns" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { describe, expect, test } from 'vitest' | ||
import { readFileSync } from 'fs' | ||
|
||
import { get } from '#src/tests/helpers/e2etest.js' | ||
|
||
describe('secret-scanning pipeline', () => { | ||
const { targetFilename } = JSON.parse(readFileSync('src/secret-scanning/lib/config.json')) | ||
// This test ensures that the configured page exists. If the page moves | ||
// this test will fail. | ||
test(`check if ${targetFilename} was moved`, async () => { | ||
const page = await get(`/${targetFilename}`, { followRedirects: true }) | ||
expect(page.statusCode).toBe(200) | ||
}) | ||
}) |
This comment was marked as spam.
Sorry, something went wrong.
Scottmiller666Sep 3, 2024