This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (85 loc) · 2.86 KB
/
code-scanning.yaml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: "Code scanning"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 9 * * 1'
jobs:
code-scanning-php-analyze:
name: Perform code scanning (PHP) - Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Upgrade PHP version
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
# Install Psalm
- name: Install Psalm
shell: bash
run: composer global require vimeo/psalm --prefer-dist --no-progress --dev
- name: Composer install
shell: bash
run: composer install --no-scripts --no-progress
- name: Run psalm init before installing any plugins
shell: bash
run: |-
~/.composer/vendor/bin/psalm --version
~/.composer/vendor/bin/psalm --root=. --init
# Perform analysis
- name: Psalm run taint analysis
run: |-
~/.composer/vendor/bin/psalm --root=. --version
~/.composer/vendor/bin/psalm --root=. --output-format=github --taint-analysis --report=results-taint-analysis.sarif
# Upload SARIF format (supported by GitHub) to the repository
- name: Upload Security Analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results-taint-analysis.sarif
code-scanning-php-codescan:
name: Perform code scanning (PHP) - Code scan
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Upgrade PHP version
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
# Install Psalm
- name: Install Psalm
shell: bash
run: composer global require vimeo/psalm --prefer-dist --no-progress --dev
- name: Composer install
shell: bash
run: composer install --no-scripts --no-progress
- name: Run psalm init before installing any plugins
shell: bash
run: |-
~/.composer/vendor/bin/psalm --version
~/.composer/vendor/bin/psalm --root=. --init
# Perform analysis
- name: Psalm run normal
continue-on-error: true
run: |-
~/.composer/vendor/bin/psalm --root=. --version
~/.composer/vendor/bin/psalm --root=. --output-format=github --report=results-normal.sarif --report-show-info=false
# Upload SARIF format (supported by GitHub) to the repository
- name: Upload normal results to GitHub
if: always()
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results-normal.sarif