|
5 | 5 | workflow_dispatch: |
6 | 6 | inputs: |
7 | 7 | branch: |
8 | | - description: Branch label to attach to the FOSSA scan. |
| 8 | + description: Override the FOSSA branch label (defaults to the dispatched git ref). |
9 | 9 | required: false |
10 | | - default: master |
| 10 | + default: "" |
11 | 11 |
|
12 | 12 | concurrency: |
13 | 13 | group: fossa-${{ github.workflow }}-${{ github.ref }} |
14 | 14 | cancel-in-progress: true |
15 | 15 |
|
| 16 | +# Each PyPI artifact is scanned as its own FOSSA project so license inventory, |
| 17 | +# policy gates, and attribution reports match what is actually shipped. The |
| 18 | +# FOSSA "branch" axis is left to its intended purpose (track license drift |
| 19 | +# across git branches over time). |
16 | 20 | jobs: |
17 | 21 | fossa: |
18 | | - name: FOSSA scan |
| 22 | + name: FOSSA ${{ matrix.package.project }} |
19 | 23 | runs-on: |
20 | 24 | group: infra1-runners-arc |
21 | 25 | labels: runners-small |
22 | 26 | permissions: |
23 | 27 | contents: read |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + package: |
| 32 | + - { path: packages/gooddata-sdk, project: gooddata-sdk } |
| 33 | + - { path: packages/gooddata-pandas, project: gooddata-pandas } |
| 34 | + - { path: packages/gooddata-dbt, project: gooddata-dbt } |
| 35 | + - { path: packages/gooddata-fdw, project: gooddata-fdw } |
| 36 | + - { path: packages/gooddata-flight-server, project: gooddata-flight-server } |
| 37 | + - { path: packages/gooddata-flexconnect, project: gooddata-flexconnect } |
| 38 | + - { path: packages/gooddata-pipelines, project: gooddata-pipelines } |
| 39 | + - { path: gooddata-api-client, project: gooddata-api-client } |
24 | 40 | steps: |
25 | 41 | - name: Checkout the code |
26 | 42 | uses: actions/checkout@v6 |
27 | 43 | with: |
28 | 44 | fetch-depth: 0 |
29 | 45 |
|
30 | | - - name: Check that .fossa.yml exists |
| 46 | + - name: Scope .fossa.yml to ${{ matrix.package.project }} |
31 | 47 | shell: bash |
32 | 48 | run: | |
33 | | - [ -f ./.fossa.yml ] || { echo "Missing .fossa.yml in repo root; FOSSA needs it for project id." >&2; exit 1; } |
| 49 | + # Target the existing "1.0" release of the gooddata-python-sdk |
| 50 | + # release group. FOSSA does not auto-create releases during analyze, |
| 51 | + # so the release must already exist; "1.0" is the one currently in |
| 52 | + # app.fossa.com. (TODO: create a per-version release before switching |
| 53 | + # the release label back to the workspace version.) |
| 54 | + cat > .fossa.yml <<EOF |
| 55 | + version: 3 |
| 56 | + project: |
| 57 | + id: ${{ matrix.package.project }} |
| 58 | + releaseGroup: |
| 59 | + name: gooddata-python-sdk |
| 60 | + release: "1.0" |
| 61 | + telemetry: |
| 62 | + scope: 'off' |
| 63 | + paths: |
| 64 | + only: |
| 65 | + - ${{ matrix.package.path }} |
| 66 | + EOF |
34 | 67 |
|
35 | 68 | - name: Workaround for "no targets found" error |
36 | 69 | shell: bash |
|
41 | 74 | uses: fossas/fossa-action@v1.9.0 |
42 | 75 | with: |
43 | 76 | api-key: ${{ secrets.FOSSA_API_KEY }} |
44 | | - branch: ${{ inputs.branch }} |
| 77 | + branch: ${{ inputs.branch != '' && inputs.branch || github.ref_name }} |
45 | 78 |
|
| 79 | + # `fossa test` resolves the revision by VCS hash and does not accept a |
| 80 | + # --branch flag (only `fossa analyze` does), so the branch input is |
| 81 | + # intentionally omitted here to avoid an "Invalid option `--branch'" error. |
46 | 82 | - name: Run FOSSA test (policy gate) |
47 | 83 | uses: fossas/fossa-action@v1.9.0 |
48 | 84 | with: |
|
0 commit comments