Skip to content

Commit 66eb488

Browse files
committed
Correct fossa workflow. Add triggered events
1 parent e573239 commit 66eb488

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.github/workflows/fossa-analyze.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
pull_request_target:
55
branches:
66
- main
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- 'gradle/libs.versions.toml'
12+
workflow_dispatch:
713

814
jobs:
915
dump-unicode-data:
@@ -16,8 +22,8 @@ jobs:
1622
- name: 'Checkout Repository'
1723
uses: actions/checkout@v4
1824
with:
19-
repository: ${{ github.event.pull_request.head.repo.full_name }}
20-
ref: ${{ github.event.pull_request.head.sha }}
25+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
26+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
2127
- uses: actions/setup-java@v4
2228
with:
2329
distribution: temurin
@@ -43,13 +49,12 @@ jobs:
4349
uses: gradle/actions/setup-gradle@v3
4450
with:
4551
gradle-version: wrapper
46-
- name: Install fossa cli
47-
run: "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash"
48-
- name: Run FOSSA analyze
49-
run: fossa analyze --project json-schema-validator --branch ${{ github.event.pull_request.head.ref }}
50-
env:
51-
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
52-
- name: Run FOSSA analyze
53-
run: fossa test --project json-schema-validator
54-
env:
55-
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
52+
- uses: fossas/fossa-action@v1
53+
with:
54+
api-key: ${{secrets.FOSSA_API_KEY}}
55+
branch: ${{ github.event.pull_request.head.ref || github.ref_name }}
56+
- uses: fossas/fossa-action@v1
57+
if: github.event_name != 'push'
58+
with:
59+
api-key: ${{secrets.FOSSA_API_KEY}}
60+
run-tests: true

0 commit comments

Comments
 (0)