|
18 | 18 | # To guarantee Maintained check is occasionally updated. See
|
19 | 19 | # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
20 | 20 | schedule:
|
21 |
| - - cron: '29 15 * * 6' |
| 21 | + - cron: "29 15 * * 6" |
22 | 22 | push:
|
23 |
| - branches: [ "main" ] |
| 23 | + branches: ["main"] |
| 24 | + # Add pull_request trigger to check PRs |
| 25 | + pull_request: |
| 26 | + branches: ["main"] |
24 | 27 |
|
25 | 28 | # Declare default permissions as read only.
|
26 | 29 | permissions: read-all
|
|
55 | 58 | # - See https://github.com/ossf/scorecard-action#publishing-results.
|
56 | 59 | publish_results: true
|
57 | 60 |
|
| 61 | + # Enable only Pinned-Dependencies check |
| 62 | + checks: pinned-dependencies |
| 63 | + |
| 64 | + # Add step to fail if Pinned-Dependencies check fails |
| 65 | + - name: "Check Pinned Dependencies Score" |
| 66 | + run: | |
| 67 | + score=$(jq -r '.runs[0].results[] | select(.ruleId=="pinned-dependencies") | .score' results.sarif) |
| 68 | + if (( $(echo "$score < 9" | bc -l) )); then |
| 69 | + echo "Pinned-Dependencies check failed with score: $score" |
| 70 | + echo "Please ensure all dependencies are pinned to specific versions." |
| 71 | + echo "Common locations to check:" |
| 72 | + echo "- GitHub Actions workflow files (.github/workflows/*.yml)" |
| 73 | + echo "- Package manager files (package.json, requirements.txt, etc.)" |
| 74 | + echo "- Docker images in Dockerfiles" |
| 75 | + exit 1 |
| 76 | + fi |
| 77 | + echo "Pinned-Dependencies check passed with score: $score" |
| 78 | +
|
58 | 79 | # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
59 | 80 | # format to the repository Actions tab.
|
60 | 81 | - name: "Upload artifact"
|
|
69 | 90 | uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
|
70 | 91 | with:
|
71 | 92 | sarif_file: results.sarif
|
| 93 | + |
| 94 | + # Reference to the main all-jobs-succeed job |
| 95 | + all-jobs-succeed: |
| 96 | + needs: [analysis] |
| 97 | + if: false # This job never runs, it's just for dependency tracking |
| 98 | + runs-on: ubuntu-latest |
| 99 | + steps: |
| 100 | + - run: echo "This job is never executed, it exists only for dependency tracking" |
0 commit comments