Skip to content

Commit

Permalink
ci: add review dependencies workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Vazquez <[email protected]>
  • Loading branch information
austinvazquez committed Dec 24, 2024
1 parent 8a72057 commit c62a511
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 13 deletions.
9 changes: 9 additions & 0 deletions .github/dependency-review-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Fail third party dependency usage if not covered by the curated set of pre-approved licenses.
#
# List was generated from guidance set forth by Amazon open source usage policies.
allow-licenses:
- 'Apache-2.0'
- 'BSD-2-Clause'
- 'BSD-3-Clause'
- 'ISC'
- 'MIT'
4 changes: 0 additions & 4 deletions .github/workflows/ci-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: echo "Skipping CI for docs & contrib files"
check-licenses:
runs-on: ubuntu-latest
steps:
- run: echo "Skipping CI for docs & contrib files"
macos-e2e-tests:
strategy:
matrix:
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,6 @@ jobs:
# TODO: Use `go mod tidy --check` after https://github.com/golang/go/issues/27005 is fixed.
- run: go mod tidy
- run: git diff --exit-code
check-licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- run: make check-licenses
macos-e2e-tests:
strategy:
fail-fast: false
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/review-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Review dependencies

on:
pull_request:
branches: ['main', 'release/**']
paths:
- 'go.*'

jobs:
review:
runs-on: ubuntu-latest

permissions:
# Write permissions needed to comment review results on PR.
# Pwn request risk mitigated by using pull_request workflow trigger
# and external contributor workflow runs require maintainer approval.
pull-requests: write

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
with:
config-file: './.github/dependency-review-config.yml'
comment-summary-in-pr: always
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ download-licenses:

### dependencies in release-please.yaml - end ###

### dependencies in review-dependencies.yaml - start ###

mkdir -p "$(LICENSEDIR)/github.com/actions/dependency-review-action"
curl https://github.com/actions/dependency-review-action/main/LICENSE --output "$(LICENSEDIR)/github.com/actions/dependency-review-action/LICENSE"

### dependencies in review-dependencies.yaml - end ###

### system-level dependencies - start ###

mkdir -p "$(LICENSEDIR)/github.com/lima-vm/lima"
Expand Down

0 comments on commit c62a511

Please sign in to comment.