Skip to content

.github/workflows/fossa.yml #26

.github/workflows/fossa.yml

.github/workflows/fossa.yml #26

Workflow file for this run

name: FOSSA Report Generation
on:
workflow_dispatch:
inputs:
version_number_for_report_generation:
type: string
description: 'Supply the DaticalDb-installer version variable which is used during its report generation to be stored in the s3 bucket. eg 8.7.352'
required: false
jobs:
wait-for-fossa-report-generation:
runs-on: ubuntu-latest
strategy:
matrix:
repo: [
{ name: "DaticalDB-installer", ref: "DAT-18919",owner: "Datical" },
#{name: "ephemeral-database", ref: "master",owner: "liquibase"}, #TODO: producing html report instead of csv. CSV report already uploaded in s3 to unblock the combine-fossa-reports job
{ name: "drivers", ref: "DAT-18919",owner: "Datical" },
# {name: "protoclub", ref: "develop",owner: "Datical"}, #TODO: producing html report instead of csv. CSV report already uploaded in s3 to unblock the combine-fossa-reports job
{ name: "datical-sqlparser", ref: "DAT-18919",owner: "Datical" },
{ name: "storedlogic", ref: "DAT-18919",owner: "Datical" },
{ name: "AppDBA", ref: "DAT-18919",owner: "Datical" },
{ name: "liquibase-bundle", ref: "DAT-18919",owner: "Datical" },
{ name: "liquibase", ref: "DAT-18919",owner: "Datical" }
]
name: "${{ matrix.repo.name }} - Fossa Report"
steps:
- name: Set workflow inputs
run: |
if [[ "${{ matrix.repo.name }}" ]]; then
echo "WORKFLOW_INPUTS={ \"version_number_for_report_generation\": \"${{ github.event.inputs.version_number_for_report_generation }}\" }" >> $GITHUB_ENV
else
echo "WORKFLOW_INPUTS={}" >> $GITHUB_ENV
fi
- name: Dispatch an action and get the run ID
uses: codex-/return-dispatch@v1
id: return_dispatch
continue-on-error: true
with:
token: ${{ secrets.FOSSA_TRIGGER_REPORT_GENERATION }}
ref: ${{ matrix.repo.ref }}
repo: ${{ matrix.repo.name }}
owner: ${{ matrix.repo.owner }}
workflow: fossa.yml
workflow_inputs: ${{ env.WORKFLOW_INPUTS }}
- name: Retry fetching run ID (max 4 attempts with 5 seconds delay)
run: |
retries=4
delay=5 # Delay of 5 seconds between retries
for i in $(seq 1 $retries); do
run_id="${{ steps.return_dispatch.outputs.run_id }}"
if [ -n "$run_id" ]; then
echo "Found run ID: $run_id"
echo "run_id=$run_id" >> $GITHUB_ENV
break
else
echo "Run ID not found, retrying in $delay seconds..."
fi
if [ $i -eq $retries ]; then
echo "Failed to get run ID after $retries attempts."
exit 1
fi
# Wait before retrying
sleep $delay
done
shell: bash
- name: Await Run ID ${{ steps.return_dispatch.outputs.run_id }}
uses: Codex-/await-remote-run@v1
with:
token: ${{ secrets.FOSSA_TRIGGER_REPORT_GENERATION }}
run_id: ${{ steps.return_dispatch.outputs.run_id }}
repo: ${{ matrix.repo.name }}
owner: ${{ matrix.repo.owner }}
run_timeout_seconds: 420 # 7 minutes Time until giving up on the run
poll_interval_ms: 120000 # 2 minutes Frequency to poll the run for a status.