Skip to content

Commit e470c6f

Browse files
Merge pull request #30 from AikidoSec/feat/expose-scan-result-url
Expose scan result URL
2 parents 2c304c8 + d18f4b4 commit e470c6f

File tree

9 files changed

+5920
-3286
lines changed

9 files changed

+5920
-3286
lines changed

.github/workflows/test.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
name: Test action
22
on:
33
pull_request:
4-
push:
54
branches:
6-
- main
5+
- '*'
76

87
jobs:
98
test:
109
runs-on: ubuntu-latest
1110
steps:
1211
- uses: actions/checkout@v3
12+
1313
- name: Test action on current repository
14+
id: scan
1415
uses: ./
1516
with:
1617
secret-key: ${{ secrets.AIKIDO_SECRET_KEY }}
18+
minimum-severity: 'MEDIUM'
19+
github-token: ${{ secrets.GITHUB_TOKEN }}
20+
post-scan-status-comment: true

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
fail-on-iac-scan: false
3131
minimum-severity: 'CRITICAL'
3232
timeout-seconds: 180
33+
post-scan-status-comment: true
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
3335
```
3436
3537
The action has 3 possible outcomes:
@@ -46,6 +48,9 @@ Optional fields:
4648
- `fail-on-dependency-scan`: Determines wether Aikido should block on new dependency issues (CVEs).
4749
- `fail-on-sast-scan`: Determines wether Aikido should block on new SAST issues. This is available in all [paid plans](https://www.aikido.dev/pricing).
4850
- `fail-on-iac-scan`: Determines wether Aikido should block on new Infrastructure as Code issues. This is available in all [paid plans](https://www.aikido.dev/pricing).
51+
- `post-scan-status-comment`: Let Aikido post a comment on the PR (when in PR context) with the latest scan status and a link to the scan results.
52+
- `github-token`: Optional. If the default `${{ secrets.GITHUB_TOKEN }}` environment token does not have write capabilities, Aikido needs a PAT with specific permissions to read and write comments in a PR.
53+
4954

5055
## Contributing
5156

action.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,22 @@ inputs:
2929
description: 'Provide a number of seconds the action will wait for scans to complete.'
3030
required: false
3131
default: "120"
32+
post-scan-status-comment:
33+
description: 'Let Aikido post a comment on the PR with a summary of the status, this comment will be updated for each scan.'
34+
required: false
35+
default: "false"
36+
github-token:
37+
description: 'A token that the action can use to post the status comment, this can be the default GITHUB_TOKEN from the environment with permissions to list and post comments, or a custom PAT.'
38+
required: false
39+
default: ""
3240
outputs:
3341
outcome:
3442
description: |
3543
'The outcome of the scan. This will return `SUCCESS` in case we managed to do a scan and no new critical issues were found.\n
3644
When we did not get results back in time, within 2 minutes, we will return a `TIMEOUT` status but not let the action fail.
3745
In case we did detect a new critical issue, the action will fail and outcome will be `FAILED`'
46+
scanResultUrl:
47+
description: 'A link to the scan results in Aikido.'
3848
runs:
3949
using: 'node16'
4050
main: 'dist/index.js'

0 commit comments

Comments
 (0)