-
Notifications
You must be signed in to change notification settings - Fork 213
54 lines (45 loc) · 1.48 KB
/
pull-request.snyk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: "CI"
# This workflow will run after a pull request is opened or updated, assuming the pull request is labeled with "Vetted".
on:
workflow_run:
workflows:
- "Pull Request / Run Checks"
types:
- completed
permissions:
checks: write
jobs:
snyk:
name: "Snyk"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # [email protected]
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
extensions: mbstring
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: composer install --no-progress
- uses: snyk/actions/php@b98d498629f1c368650224d6d212bf7dfa89e4bf # [email protected]
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- uses: actions/github-script@v6
env:
parameter_url: '${{ github.event.workflow_run.html_url }}'
with:
script: |
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
head_sha: context.sha,
name: "Snyk",
status: "completed",
conclusion: "${{ github.event.workflow_run.conclusion }}",
details_url: process.env.parameter_url
});