Skip to content

Commit 8954ece

Browse files
justaugustusclaude
andauthored
ci: Add scorecard-monitor integration with Allstar results (#78)
* ci: add scorecard-monitor integration with results file Update the Allstar workflow to: - Use the results-json-output branch (includes SARIF upload + results file output) - Pass -results-file to produce Scorecard JSON v2 output - Add a monitor job that feeds the results into scorecard-monitor for dashboard reporting - Use peter-evans/create-pull-request for human review of report updates (matching bloomberg/.github pattern) The monitor job uses scorecard-monitor's results-path input (ossf/scorecard-monitor#90) to consume Allstar's output and generate a Markdown report with score history. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Stephen Augustus <foo@auggie.dev> * Apply suggestions from code review Co-authored-by: Stephen Augustus <justaugustus@users.noreply.github.com> Signed-off-by: Stephen Augustus <justaugustus@users.noreply.github.com> --------- Signed-off-by: Stephen Augustus <foo@auggie.dev> Signed-off-by: Stephen Augustus <justaugustus@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5ea41c5 commit 8954ece

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

.github/workflows/allstar.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727
with:
2828
repository: ossf/allstar
29-
ref: evidence-upload
29+
ref: results-json-output
3030
persist-credentials: false
3131
- name: Setup Go
3232
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
@@ -45,7 +45,7 @@ jobs:
4545
APP_ID: ${{ vars.APP_ID }}
4646
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
4747
run: |
48-
./allstar -once -policy "OpenSSF Scorecard" 2> "$ARTIFACT_DIR/allstar.log" | tee "$ARTIFACT_DIR/allstar.out"
48+
./allstar -once -policy "OpenSSF Scorecard" -results-file "$ARTIFACT_DIR/results.json" 2> "$ARTIFACT_DIR/allstar.log" | tee "$ARTIFACT_DIR/allstar.out"
4949
if [ -s "$ARTIFACT_DIR/allstar.log" ]; then
5050
echo "==== Errors ===="
5151
cat "$ARTIFACT_DIR/allstar.log"
@@ -56,3 +56,40 @@ jobs:
5656
with:
5757
name: allstar-scan
5858
path: ${{ env.ARTIFACT_DIR }}
59+
60+
monitor:
61+
runs-on: ubuntu-latest
62+
needs: scan
63+
permissions:
64+
contents: write
65+
pull-requests: write
66+
steps:
67+
- name: Checkout this repo
68+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
69+
with:
70+
persist-credentials: false
71+
- name: Download scan artifacts
72+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
73+
with:
74+
name: allstar-scan
75+
path: ${{ env.ARTIFACT_DIR }}
76+
- name: OpenSSF Scorecard Monitor
77+
uses: ossf/scorecard-monitor@local-results # TODO: pin to release once merged
78+
id: scorecard-monitor
79+
with:
80+
results-path: ${{ env.ARTIFACT_DIR }}/results.json
81+
database: reports/database.json
82+
report: reports/scorecard-report.md
83+
auto-commit: false
84+
auto-push: false
85+
github-token: ${{ secrets.GITHUB_TOKEN }}
86+
- name: Create pull request
87+
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
88+
with:
89+
token: ${{ secrets.GITHUB_TOKEN }}
90+
commit-message: Update Scorecard Monitor report
91+
title: Update Scorecard Monitor report
92+
body: Automated Scorecard report update from Allstar scan.
93+
base: main
94+
branch: scorecard-report-update
95+
delete-branch: true

0 commit comments

Comments
 (0)