Skip to content

Commit 6ceb7e4

Browse files
committed
feat(COD-6066): add a working directory option to the action
1 parent d6c79c4 commit 6ceb7e4

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/integration-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ jobs:
2626
with:
2727
distribution: "temurin"
2828
java-version: "17"
29-
- name: Move action
29+
- name: Copy action code
3030
run: |
3131
mkdir ../action
32-
mv * ../action
33-
mv ../action/sample-repo/* .
32+
rsync -a --exclude='sample-repo' . ../action
33+
- run: ls -alh
3434
- name: Run action
3535
id: run-action
3636
uses: ./../action
3737
with:
3838
target: push
39-
sources: ${{ github.workspace }}
39+
sources: sample-repo
4040
code-scanning-path: scanning-report.sarif
4141
- name: Check run succeeded
4242
env:

src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const comparisonMarkdownPath = 'comparison.md'
1616

1717
async function runAnalysis() {
1818
const target = getInput('target')
19+
const sources = getInput('sources')
1920

2021
let currBranch = getOptionalEnvVariable('GITHUB_HEAD_REF', '')
2122
if (currBranch !== '') {
@@ -31,7 +32,16 @@ async function runAnalysis() {
3132
const toUpload: string[] = []
3233

3334
// command to print both sarif and lwjson formats
34-
var args = ['scan', '.', '--formats', 'sarif', '--output', sarifReportPath, '--deployment', 'ci']
35+
var args = [
36+
'scan',
37+
sources,
38+
'--formats',
39+
'sarif',
40+
'--output',
41+
sarifReportPath,
42+
'--deployment',
43+
'ci',
44+
]
3545
if (target === 'push') {
3646
args.push('--save-results')
3747
}

0 commit comments

Comments
 (0)