fix: resolve cross-entity slug references during configuration import #64
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SBOM | |
| on: | |
| push: | |
| branches: [main, development, feature/**, bugfix/**, hotfix/**] | |
| pull_request: | |
| branches: [main, development] | |
| jobs: | |
| sbom: | |
| runs-on: ubuntu-latest | |
| name: "SBOM Generation & Validation" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.3" | |
| extensions: mbstring, intl, zip, gd, curl, xml, json | |
| tools: composer:v2 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install Composer dependencies | |
| run: composer install --no-progress --prefer-dist --optimize-autoloader | |
| - name: Generate PHP SBOM | |
| run: composer CycloneDX:make-sbom --output-format=JSON --output-file=bom-php.cdx.json --spec-version=1.5 --omit=dev --omit=plugin | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Generate npm SBOM | |
| run: npx @cyclonedx/cyclonedx-npm --output-file bom-npm.cdx.json --spec-version 1.5 --omit dev | |
| - name: Merge PHP + npm SBOMs | |
| run: | | |
| jq -s '.[0] * {components: ([.[].components[]?] | unique_by(.purl // .name))}' bom-php.cdx.json bom-npm.cdx.json > sbom.cdx.json | |
| - name: Install Grype | |
| uses: anchore/scan-action/download-grype@v5 | |
| - name: CVE scan SBOM | |
| run: grype sbom:sbom.cdx.json --fail-on critical | |
| - name: Composer audit | |
| run: composer audit --format=json || true | |
| - name: npm audit | |
| run: npm audit --audit-level=critical | |
| - name: Commit SBOM | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add sbom.cdx.json | |
| if git diff --cached --quiet; then | |
| echo "No SBOM changes to commit" | |
| else | |
| git commit -m "chore: update SBOM" | |
| git push | |
| fi | |
| - name: Upload SBOM artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sbom-openconnector | |
| path: sbom.cdx.json | |
| retention-days: 90 | |
| - name: Attach SBOM to release | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: sbom.cdx.json |