Skip to content

Commit 0e6fcdb

Browse files
committed
Improve README with additional notes
1 parent 2036600 commit 0e6fcdb

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
# `code-scanning-playground`
22
> :wave: :earth_americas: a playground for **Code Scanning** :roller_coaster:
33
4+
## Contents
5+
- [About](#about)
6+
- [How it works](#how-it-works)
7+
- [Getting started](#getting-started)
8+
- [Additional resources](#additional-resources)
9+
410
## About
5-
This repo demonstrates GitHub's [Code Scanning feature](), using ESLint to generate a "code scanning alert" in the Security tab.
11+
This is a template repo, demonstrating GitHub's [Code Scanning capability](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning), using ESLint to generate a "code scanning alert" in GitHub's Security tab:
612

713
![example](images/example.png)
814

9-
Register for the code scanning beta [here](https://github.com/features/security/advanced-security/signup).
15+
## How it works
16+
- The ESLint analysis workflow [runs on a schedule, and on every `push`](https://github.com/swinton/code-scanning-playground/blob/20366008d4376dd1899559fba0bf5fbbece109c3/.github/workflows/upload-sarif.yml#L3-L8)
17+
- The ESLint output is [formatted as SARIF](https://github.com/swinton/code-scanning-playground/blob/20366008d4376dd1899559fba0bf5fbbece109c3/.github/workflows/upload-sarif.yml#L18-L20), using the [`@microsoft/eslint-formatter-sarif`](https://github.com/microsoft/sarif-sdk/tree/master/src/ESLint.Formatter#readme) package
18+
- The SARIF report is submitted to GitHub via the [`github/codeql-action/upload-sarif`](https://github.com/github/codeql-action/tree/main/upload-sarif) action
19+
20+
## Getting started
21+
1. Register for the code scanning beta [here](https://github.com/features/security/advanced-security/signup)
22+
1. [Generate a copy of this repo](https://github.com/swinton/code-scanning-playground/generate)
23+
1. Push a commit -- it can even be an empty commit (`git commit --allow-empty`)
24+
1. Observe as a new security alert is generated
1025

11-
## Resources
12-
* microsoft/sarif-tutorials: User-friendly documentation for the SARIF file format., https://github.com/microsoft/sarif-tutorials
13-
* SARIF support for code scanning - GitHub Docs, https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/sarif-support-for-code-scanning
14-
* Example workflow that runs the ESLint analysis tool, https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/uploading-a-sarif-file-to-github#example-workflow-that-runs-the-eslint-analysis-tool
15-
* REST API: https://docs.github.com/en/rest/reference/code-scanning
26+
## Additional resources
27+
- [SARIF example output](example.sarif.json)
28+
- [`microsoft/sarif-tutorials`](https://github.com/microsoft/sarif-tutorials): User-friendly documentation for the SARIF file format
29+
- [SARIF support for code scanning](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/sarif-support-for-code-scanning)
30+
- [Example workflow that runs the ESLint analysis tool](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/uploading-a-sarif-file-to-github#example-workflow-that-runs-the-eslint-analysis-tool)
31+
- REST API: https://docs.github.com/en/rest/reference/code-scanning

0 commit comments

Comments
 (0)