diff --git a/.github/workflows/pages-deploy.yml b/.github/workflows/pages-deploy.yml
index 6c52137b..835fdac2 100644
--- a/.github/workflows/pages-deploy.yml
+++ b/.github/workflows/pages-deploy.yml
@@ -32,8 +32,23 @@ concurrency:
cancel-in-progress: false
jobs:
+ build:
+ name: Build docs artifact
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ ref: ${{ inputs.ref || github.ref }}
+ fetch-depth: 1
+ persist-credentials: false
+ - uses: actions/configure-pages@v5
+ - uses: actions/upload-pages-artifact@v3
+ with:
+ path: docs
deploy:
name: Deploy docs/ and smoke the live URL
+ needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
@@ -45,10 +60,6 @@ jobs:
ref: ${{ inputs.ref || github.ref }}
fetch-depth: 1
persist-credentials: false
- - uses: actions/configure-pages@v5
- - uses: actions/upload-pages-artifact@v3
- with:
- path: docs
- id: deployment
uses: actions/deploy-pages@v4
- name: Post-deploy smoke (live URL)
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
index e57fcedd..d47c82eb 100644
--- a/.github/workflows/scorecard.yml
+++ b/.github/workflows/scorecard.yml
@@ -33,6 +33,7 @@ jobs:
fetch-depth: 1
persist-credentials: false
- name: Install and run Scorecard (pinned, checksum-verified)
+ continue-on-error: true
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
@@ -44,6 +45,9 @@ jobs:
(cd /tmp && grep "scorecard_${VERSION}_linux_amd64.tar.gz" scorecard_checksums.txt | sha256sum -c -)
tar -xzf "/tmp/scorecard_${VERSION}_linux_amd64.tar.gz" -C /tmp scorecard
/tmp/scorecard --repo="github.com/$GITHUB_REPOSITORY" --format json --output scorecard.json --show-details
- - name: Print the Scorecard result
+ - name: Validate and print the Scorecard result
if: always()
- run: cat scorecard.json || true
+ run: |
+ test -s scorecard.json
+ node -e "const r=require('./scorecard.json'); if (!Array.isArray(r.checks) || r.checks.length === 0) process.exit(1); console.log('SCORECARD score='+r.score+' checks='+r.checks.length);"
+ cat scorecard.json
diff --git a/docs/CI-en.html b/docs/CI-en.html
index b0fe7465..05c5121b 100644
--- a/docs/CI-en.html
+++ b/docs/CI-en.html
@@ -44,7 +44,7 @@
| Job | Runner | Timeout (min) | Steps | Guards | Artifacts | Summaries |
|---|
| Deep sweep (node 24) | ubuntu-latest | 45 | 7 | 0 | 0 | 1 |
Pages Deploy pages-deploy.yml
Triggers: push · workflow_dispatch · Permissions: contents, pages, id-token · Concurrency: no cancel
-| Job | Runner | Timeout (min) | Steps | Guards | Artifacts | Summaries |
|---|
| Deploy docs/ and smoke the live URL | ubuntu-latest | 10 | 6 | 0 | 0 | 1 |
+| Job | Runner | Timeout (min) | Steps | Guards | Artifacts | Summaries |
|---|
| Build docs artifact | ubuntu-latest | 10 | 3 | 0 | 0 | 0 |
| Deploy docs/ and smoke the live URL | ubuntu-latest | 10 | 4 | 0 | 0 | 1 |
npm release (gated) release.yml
Triggers: push · workflow_dispatch · Permissions: contents, id-token · Concurrency: no cancel
| Job | Runner | Timeout (min) | Steps | Guards | Artifacts | Summaries |
|---|
| publish | ubuntu-latest | 30 | 12 | 0 | 0 | 0 |
diff --git a/docs/CI.html b/docs/CI.html
index 3ebd2f9a..34483606 100644
--- a/docs/CI.html
+++ b/docs/CI.html
@@ -44,7 +44,7 @@
| الوظيفة | المنفّذ | المهلة (دقيقة) | الخطوات | الحراس | القطع الأثرية | ملخصات |
|---|
| Deep sweep (node 24) | ubuntu-latest | 45 | 7 | 0 | 0 | 1 |
Pages Deploy pages-deploy.yml
المشغلات: push · workflow_dispatch · الصلاحيات: contents, pages, id-token · التزامن: no cancel
-| الوظيفة | المنفّذ | المهلة (دقيقة) | الخطوات | الحراس | القطع الأثرية | ملخصات |
|---|
| Deploy docs/ and smoke the live URL | ubuntu-latest | 10 | 6 | 0 | 0 | 1 |
+| الوظيفة | المنفّذ | المهلة (دقيقة) | الخطوات | الحراس | القطع الأثرية | ملخصات |
|---|
| Build docs artifact | ubuntu-latest | 10 | 3 | 0 | 0 | 0 |
| Deploy docs/ and smoke the live URL | ubuntu-latest | 10 | 4 | 0 | 0 | 1 |
npm release (gated) release.yml
المشغلات: push · workflow_dispatch · الصلاحيات: contents, id-token · التزامن: no cancel
| الوظيفة | المنفّذ | المهلة (دقيقة) | الخطوات | الحراس | القطع الأثرية | ملخصات |
|---|
| publish | ubuntu-latest | 30 | 12 | 0 | 0 | 0 |
diff --git a/test/ci/security-workflows-contract.test.js b/test/ci/security-workflows-contract.test.js
index 0870b615..ffb6570f 100644
--- a/test/ci/security-workflows-contract.test.js
+++ b/test/ci/security-workflows-contract.test.js
@@ -39,6 +39,10 @@ export function validateSecurity({ codeql, dependencyReview, scorecard }) {
if (!scorecardText.includes("scorecard_checksums.txt")) errors.push("scorecard: checksum file missing");
if (!scorecardText.includes("--format json")) errors.push("scorecard: JSON format missing");
if (!uses(scorecard).some((u) => /^actions\/checkout@v\d+$/.test(u))) errors.push("scorecard: checkout step missing");
+ const scorecardRun = scorecard?.jobs?.analysis?.steps?.find((st) => String(st.run || "").includes("--format json"));
+ if (scorecardRun?.["continue-on-error"] !== true) errors.push("scorecard: analysis must tolerate a permission-limited check");
+ const scorecardValidate = scorecard?.jobs?.analysis?.steps?.find((st) => String(st.run || "").includes("test -s scorecard.json"));
+ if (!scorecardValidate) errors.push("scorecard: JSON validation step missing");
return errors;
}
@@ -64,6 +68,14 @@ test("security workflows: negative controls bite", () => {
const runStep = d.jobs.analysis.steps.find((st) => String(st.run || "").includes("--format json"));
runStep.run = runStep.run.replace("--format json", "");
assert.ok(validateSecurity({ codeql, dependencyReview, scorecard: d }).some((e) => /JSON format/.test(e)));
+ d = clone(scorecard);
+ const co = d.jobs.analysis.steps.find((st) => String(st.run || "").includes("--format json"));
+ delete co["continue-on-error"];
+ assert.ok(validateSecurity({ codeql, dependencyReview, scorecard: d }).some((e) => /tolerate/.test(e)));
+ d = clone(scorecard);
+ const val = d.jobs.analysis.steps.find((st) => String(st.run || "").includes("test -s scorecard.json"));
+ val.run = val.run.replace("test -s scorecard.json", "");
+ assert.ok(validateSecurity({ codeql, dependencyReview, scorecard: d }).some((e) => /JSON validation/.test(e)));
d = clone(dependencyReview);
const actionStep = d.jobs.review.steps.find((st) => String(st.uses || "").startsWith("actions/dependency-review-action"));
actionStep.uses = "actions/dependency-review-action@v4";