Skip to content

Commit 0166883

Browse files
Merge pull request #1195 from github/update-v1.1.19-f5d217be
Merge releases/v2 into releases/v1
2 parents af35bd3 + de68405 commit 0166883

File tree

1,922 files changed

+215084
-1643
lines changed

Some content is hidden

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

1,922 files changed

+215084
-1643
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Check Code-Scanning Config
2+
description: |
3+
Checks the code scanning configuration file generated by the
4+
action to ensure it contains the expected contents
5+
inputs:
6+
languages:
7+
required: false
8+
description: The languages field passed to the init action.
9+
10+
packs:
11+
required: false
12+
description: The packs field passed to the init action.
13+
14+
queries:
15+
required: false
16+
description: The queries field passed to the init action.
17+
18+
config-file-test:
19+
required: false
20+
description: |
21+
The location of the config file to use. If empty,
22+
then no config file is used.
23+
24+
expected-config-file-contents:
25+
required: true
26+
description: |
27+
A JSON string containing the exact contents of the config file.
28+
29+
tools:
30+
required: true
31+
description: |
32+
The url of codeql to use.
33+
34+
runs:
35+
using: composite
36+
steps:
37+
- uses: ./../action/init
38+
with:
39+
languages: ${{ inputs.languages }}
40+
config-file: ${{ inputs.config-file-test }}
41+
queries: ${{ inputs.queries }}
42+
packs: ${{ inputs.packs }}
43+
tools: ${{ inputs.tools }}
44+
db-location: ${{ runner.temp }}/codescanning-config-cli-test
45+
46+
- name: Install dependencies
47+
shell: bash
48+
run: npm install --location=global ts-node js-yaml
49+
50+
- name: Check config
51+
working-directory: ${{ github.action_path }}
52+
shell: bash
53+
run: ts-node ./index.ts "${{ runner.temp }}/user-config.yaml" '${{ inputs.expected-config-file-contents }}'
54+
55+
- name: Clean up
56+
shell: bash
57+
if: always()
58+
run: |
59+
rm -rf ${{ runner.temp }}/codescanning-config-cli-test
60+
rm -rf ${{ runner.temp }}/user-config.yaml
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
import * as core from '@actions/core'
3+
import * as yaml from 'js-yaml'
4+
import * as fs from 'fs'
5+
import * as assert from 'assert'
6+
7+
const actualConfig = loadActualConfig()
8+
9+
const rawExpectedConfig = process.argv[3].trim()
10+
if (!rawExpectedConfig) {
11+
core.info('No expected configuration provided')
12+
} else {
13+
core.startGroup('Expected generated user config')
14+
core.info(yaml.dump(JSON.parse(rawExpectedConfig)))
15+
core.endGroup()
16+
}
17+
18+
const expectedConfig = rawExpectedConfig ? JSON.parse(rawExpectedConfig) : undefined;
19+
20+
assert.deepStrictEqual(
21+
actualConfig,
22+
expectedConfig,
23+
'Expected configuration does not match actual configuration'
24+
);
25+
26+
27+
function loadActualConfig() {
28+
if (!fs.existsSync(process.argv[2])) {
29+
core.info('No configuration file found')
30+
return undefined
31+
} else {
32+
const rawActualConfig = fs.readFileSync(process.argv[2], 'utf8')
33+
core.startGroup('Actual generated user config')
34+
core.info(rawActualConfig)
35+
core.endGroup()
36+
37+
return yaml.load(rawActualConfig)
38+
}
39+
}

.github/query-filter-test/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Query Filter Test
2-
description: Runs a test of query filters using the check sarif action
2+
description: Runs a test of query filters using the check SARIF action
33
inputs:
44
sarif-file:
55
required: true
@@ -34,6 +34,8 @@ runs:
3434
config-file: ${{ inputs.config-file }}
3535
tools: ${{ inputs.tools }}
3636
db-location: ${{ runner.temp }}/query-filter-test
37+
env:
38+
TEST_MODE: "true"
3739
- uses: ./../action/analyze
3840
with:
3941
output: ${{ runner.temp }}/results
@@ -49,4 +51,4 @@ runs:
4951
queries-not-run: ${{ inputs.queries-not-run}}
5052
- name: Cleanup after test
5153
shell: bash
52-
run: rm -rf "$RUNNER_TEMP/results" "$RUNNER_TEMP//query-filter-test"
54+
run: rm -rf "$RUNNER_TEMP/results" "$RUNNER_TEMP/query-filter-test"

.github/workflows/__analyze-ref-input.yml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__autobuild-action.yml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__debug-artifacts.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.

.github/workflows/__extractor-ram-threads.yml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-queries.yml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-tracing-autobuild.yml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__go-custom-tracing.yml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)