Skip to content

Commit b11b7de

Browse files
authored
Merge pull request #11 from SecureCodeWarrior/language
Added support for fetching repository language
2 parents d62a2a7 + f03c2c4 commit b11b7de

File tree

13 files changed

+4853
-117
lines changed

13 files changed

+4853
-117
lines changed

.jest/setEnvVars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
process.env.GITHUB_REPOSITORY = 'scw/test-repo';

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Currently supports adding training material based on CWE references included in
3232
with:
3333
inputSarifFile: sarif/findings.sarif
3434
outputSarifFile: sarif/findings.processed.sarif
35+
githubToken: ${{ secrets.GITHUB_TOKEN }}
3536

3637
- name: Import Results
3738
uses: github/codeql-action/upload-sarif@v1
@@ -48,3 +49,7 @@ The SARIF file to add Secure Code Warrior contextual training material to. **Def
4849
### `outputSarifFile`
4950

5051
The SARIF file to add Secure Code Warrior contextual training material to. **Default value:** `./findings.processed.sarif`
52+
53+
### `githubToken` (optional)
54+
55+
Provide `${{ secrets.GITHUB_TOKEN }}` to use the GitHub access token automatically supplied by GitHub Workflows. This enables language-specific training links to be generated (where available) by fetching the repository language from the GitHub API.

action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ branding:
55
color: 'orange'
66
inputs:
77
inputSarifFile:
8-
description: 'relative location of SARIF file to process'
8+
description: 'Relative location of SARIF file to process'
99
required: true
1010
default: './findings.sarif'
1111
outputSarifFile:
12-
description: 'relative destination location for processed SARIF file'
12+
description: 'Relative destination location for processed SARIF file'
1313
required: true
1414
default: './findings.processed.sarif'
15+
githubToken:
16+
description: 'Provide `secrets.GITHUB_TOKEN` to use the GitHub access token automatically supplied by GitHub Workflows'
17+
required: false
1518
runs:
1619
using: 'node12'
1720
main: 'dist/index.js'

0 commit comments

Comments
 (0)