-
Notifications
You must be signed in to change notification settings - Fork 21
45 lines (37 loc) · 1.21 KB
/
vet-ci.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
name: vet OSS Components
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
issues: write
pull-requests: write
security-events: write
jobs:
vet:
name: vet
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Enable Cloud Cloud
run: echo "SAFEDEP_CLOUD_MODE=true" >> $GITHUB_ENV
- name: Override Cloud Mode if Actor is Dependabot
if: github.actor == 'dependabot[bot]'
run: echo "SAFEDEP_CLOUD_MODE=false" >> $GITHUB_ENV
- name: Override Cloud Mode if PR is from External Repository
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
run: echo "SAFEDEP_CLOUD_MODE=false" >> $GITHUB_ENV
- name: Run vet
uses: safedep/vet-action@main
with:
policy: .github/vet/policy.yml
cloud: ${{ env.SAFEDEP_CLOUD_MODE }}
cloud-key: ${{ secrets.SAFEDEP_CLOUD_API_KEY }}
cloud-tenant: ${{ secrets.SAFEDEP_CLOUD_TENANT_DOMAIN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SAFEDEP_CLOUD_MODE: ${{ env.SAFEDEP_CLOUD_MODE }}