Skip to content

Commit d6dc28c

Browse files
authored
Merge pull request #1 from niaid/ghasctl-1736355827
Updating GitHub Code Scanning Workflows
2 parents 3c91d1d + 2d57c07 commit d6dc28c

File tree

3 files changed

+117
-10
lines changed

3 files changed

+117
-10
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: "CodeQL C#"
4+
5+
on:
6+
push:
7+
branches: ["master", "main"]
8+
pull_request:
9+
# The branches below must be a subset of the branches above
10+
branches: ["master", "main"]
11+
schedule:
12+
- cron: "27 4 * * 5"
13+
14+
jobs:
15+
analyze:
16+
name: Analyze
17+
runs-on: ubuntu-latest
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
language: ["csharp"]
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
# Initializes the CodeQL tools for scanning.
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v3
35+
with:
36+
languages: ${{ matrix.language }}
37+
queries: security-extended # security-and-quality
38+
# If you wish to specify custom queries, you can do so here or in a config file.
39+
# By default, queries listed here will override any specified in a config file.
40+
# Prefix the list here with "+" to use these queries and those in the config file.
41+
42+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
43+
# If this step fails, then you should remove it and run the build manually (see below)
44+
- name: Autobuild
45+
uses: github/codeql-action/autobuild@v3
46+
47+
# ℹ️ Command-line programs to run using the OS shell.
48+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
49+
50+
# If the Autobuild fails above, remove it and uncomment the following three lines.
51+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
52+
53+
# - run: |
54+
# echo "Run, Build Application using script"
55+
# ./location_of_script_within_repo/buildscript.sh
56+
57+
- name: Perform CodeQL Analysis
58+
uses: github/codeql-action/analyze@v3
59+
with:
60+
category: "/language:${{matrix.language}}"
61+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: "CodeQL JavaScript/TypeScript"
4+
5+
on:
6+
push:
7+
branches: ["master", "main"]
8+
pull_request:
9+
# The branches below must be a subset of the branches above
10+
branches: ["master", "main"]
11+
schedule:
12+
- cron: "27 4 * * 5"
13+
14+
jobs:
15+
analyze:
16+
name: Analyze
17+
runs-on: ubuntu-latest
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
language: ["javascript"]
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
# Initializes the CodeQL tools for scanning.
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v3
35+
with:
36+
languages: ${{ matrix.language }}
37+
queries: security-extended # security-and-quality
38+
# If you wish to specify custom queries, you can do so here or in a config file.
39+
# By default, queries listed here will override any specified in a config file.
40+
# Prefix the list here with "+" to use these queries and those in the config file.
41+
42+
- name: Perform CodeQL Analysis
43+
uses: github/codeql-action/analyze@v3
44+
with:
45+
category: "/language:${{matrix.language}}"
46+

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ See [this document](https://github.com/hardkoded/puppeteer-sharp/blob/master/CON
5252
## Take screenshots
5353

5454
<!-- snippet: ScreenshotAsync -->
55-
<a id='snippet-screenshotasync'></a>
55+
<a id='snippet-ScreenshotAsync'></a>
5656
```cs
5757
using var browserFetcher = new BrowserFetcher();
5858
await browserFetcher.DownloadAsync();
@@ -62,28 +62,28 @@ await using var page = await browser.NewPageAsync();
6262
await page.GoToAsync("http://www.google.com");
6363
await page.ScreenshotAsync(outputFile);
6464
```
65-
<sup><a href='/lib/PuppeteerSharp.Tests/ScreenshotTests/PageScreenshotTests.cs#L63-L71' title='Snippet source file'>snippet source</a> | <a href='#snippet-screenshotasync' title='Start of snippet'>anchor</a></sup>
65+
<sup><a href='/lib/PuppeteerSharp.Tests/ScreenshotTests/PageScreenshotTests.cs#L63-L71' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScreenshotAsync' title='Start of snippet'>anchor</a></sup>
6666
<!-- endSnippet -->
6767

6868
You can also change the view port before generating the screenshot
6969

7070
<!-- snippet: SetViewportAsync -->
71-
<a id='snippet-setviewportasync'></a>
71+
<a id='snippet-SetViewportAsync'></a>
7272
```cs
7373
await Page.SetViewportAsync(new ViewPortOptions
7474
{
7575
Width = 500,
7676
Height = 500
7777
});
7878
```
79-
<sup><a href='/lib/PuppeteerSharp.Tests/ScreenshotTests/ElementHandleScreenshotTests.cs#L21-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-setviewportasync' title='Start of snippet'>anchor</a></sup>
79+
<sup><a href='/lib/PuppeteerSharp.Tests/ScreenshotTests/ElementHandleScreenshotTests.cs#L21-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-SetViewportAsync' title='Start of snippet'>anchor</a></sup>
8080
<!-- endSnippet -->
8181

8282

8383
## Generate PDF files
8484

8585
<!-- snippet: PdfAsync -->
86-
<a id='snippet-pdfasync'></a>
86+
<a id='snippet-PdfAsync'></a>
8787
```cs
8888
using var browserFetcher = new BrowserFetcher();
8989
await browserFetcher.DownloadAsync();
@@ -93,32 +93,32 @@ await page.GoToAsync("http://www.google.com"); // In case of fonts being loaded
9393
await page.EvaluateExpressionHandleAsync("document.fonts.ready"); // Wait for fonts to be loaded. Omitting this might result in no text rendered in pdf.
9494
await page.PdfAsync(outputFile);
9595
```
96-
<sup><a href='/lib/PuppeteerSharp.Tests/PageTests/PdfTests.cs#L29-L39' title='Snippet source file'>snippet source</a> | <a href='#snippet-pdfasync' title='Start of snippet'>anchor</a></sup>
96+
<sup><a href='/lib/PuppeteerSharp.Tests/PageTests/PdfTests.cs#L29-L39' title='Snippet source file'>snippet source</a> | <a href='#snippet-PdfAsync' title='Start of snippet'>anchor</a></sup>
9797
<!-- endSnippet -->
9898

9999
## Inject HTML
100100

101101
<!-- snippet: SetContentAsync -->
102-
<a id='snippet-setcontentasync'></a>
102+
<a id='snippet-SetContentAsync'></a>
103103
```cs
104104
await using var page = await browser.NewPageAsync();
105105
await page.SetContentAsync("<div>My Receipt</div>");
106106
var result = await page.GetContentAsync();
107107
```
108-
<sup><a href='/lib/PuppeteerSharp.Tests/PageTests/SetContentTests.cs#L21-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-setcontentasync' title='Start of snippet'>anchor</a></sup>
108+
<sup><a href='/lib/PuppeteerSharp.Tests/PageTests/SetContentTests.cs#L21-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-SetContentAsync' title='Start of snippet'>anchor</a></sup>
109109
<!-- endSnippet -->
110110

111111
## Evaluate Javascript
112112

113113
<!-- snippet: Evaluate -->
114-
<a id='snippet-evaluate'></a>
114+
<a id='snippet-Evaluate'></a>
115115
```cs
116116
await using var page = await browser.NewPageAsync();
117117
var seven = await page.EvaluateExpressionAsync<int>("4 + 3");
118118
var someObject = await page.EvaluateFunctionAsync<dynamic>("(value) => ({a: value})", 5);
119119
Console.WriteLine(someObject.a);
120120
```
121-
<sup><a href='/lib/PuppeteerSharp.Tests/QuerySelectorTests/ElementHandleQuerySelectorEvalTests.cs#L19-L24' title='Snippet source file'>snippet source</a> | <a href='#snippet-evaluate' title='Start of snippet'>anchor</a></sup>
121+
<sup><a href='/lib/PuppeteerSharp.Tests/QuerySelectorTests/ElementHandleQuerySelectorEvalTests.cs#L19-L24' title='Snippet source file'>snippet source</a> | <a href='#snippet-Evaluate' title='Start of snippet'>anchor</a></sup>
122122
<!-- endSnippet -->
123123

124124
## Wait For Selector

0 commit comments

Comments
 (0)