Skip to content

Commit 38e1c95

Browse files
authored
Merge pull request #3 from advanced-security/depreview-config
Update DepReview to use config file
2 parents f84aee3 + 055df79 commit 38e1c95

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

.github/dependency-review.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# https://github.com/actions/dependency-review-action/tree/v4/?tab=readme-ov-file#configuration-file
2+
3+
# Comment summary in PR
4+
comment-summary-in-pr: "always"
5+
6+
# Set the severity level for the action to fail on.
7+
fail-on-severity: moderate
8+
9+
# Set what scope to fail on.
10+
fail-on-scopes: runtime
11+
12+
# Here is the list of licenses we want to deny and not use in our software.
13+
deny-licenses: GPL-1.0-only,GPL-1.0-or-later,GPL-2.0-only,GPL-2.0-or-later,GPL-3.0-only,GPL-3.0-or-later,AGPL-1.0-only,AGPL-1.0-or-later,AGPL-3.0-only,AGPL-3.0-or-later,LGPL-2.0-only,LGPL-2.0-or-later,LGPL-2.1-only,LGPL-2.1-or-later,LGPL-3.0-only,LGPL-3.0-or-later

.github/workflows/dependency-review.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,25 @@ jobs:
1717
- name: 'Checkout Repository'
1818
uses: actions/checkout@v4
1919

20+
- name: 'Check for configuration file'
21+
id: check-config
22+
run: |
23+
set -e
24+
if [ -f "./.github/dependency-review.yml" ]; then
25+
echo "Found local configuration file"
26+
echo "config=./.github/labeler.yml" >> $GITHUB_STATE
27+
28+
else
29+
echo "No local configuration file found"
30+
echo "Downloading configuration file from advanced-security/reusable-workflows repository"
31+
32+
# download file using gh cli
33+
gh api repos/advanced-security/reusable-workflows/contents/.github/dependency-review.yml --raw-field "ref=main" > .github/dependency-review.yml
34+
echo "config=./.github/dependency-review.yml" >> $GITHUB_STATE
35+
36+
fi
37+
2038
- name: 'Dependency Review'
2139
uses: actions/dependency-review-action@v4
2240
with:
23-
comment-summary-in-pr: "always"
24-
fail-on-scopes: runtime
25-
fail-on-severity: moderate
26-
deny-licenses: GPL-1.0-only,GPL-1.0-or-later,GPL-2.0-only,GPL-2.0-or-later,GPL-3.0-only,GPL-3.0-or-later,AGPL-1.0-only,AGPL-1.0-or-later,AGPL-3.0-only,AGPL-3.0-or-later,LGPL-2.0-only,LGPL-2.0-or-later,LGPL-2.1-only,LGPL-2.1-or-later,LGPL-3.0-only,LGPL-3.0-or-later
41+
config-file: '${{ steps.check-config.outputs.config }}'

0 commit comments

Comments
 (0)