ci: run dist alias verification after build (single verify step)
This commit is contained in:
@@ -31,30 +31,23 @@ jobs:
|
|||||||
- name: Checkout (from event.json, no external actions)
|
- name: Checkout (from event.json, no external actions)
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
EVENT_JSON="/var/run/act/workflow/event.json"
|
EVENT_JSON="/var/run/act/workflow/event.json"
|
||||||
test -f "$EVENT_JSON" || (echo "❌ Missing $EVENT_JSON" && exit 1)
|
test -f "$EVENT_JSON" || (echo "❌ Missing $EVENT_JSON" && exit 1)
|
||||||
|
|
||||||
# Extract repo clone url + sha from event payload (push or pull_request)
|
|
||||||
eval "$(node - <<'NODE'
|
eval "$(node - <<'NODE'
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
const ev = JSON.parse(fs.readFileSync("/var/run/act/workflow/event.json","utf8"));
|
const ev = JSON.parse(fs.readFileSync("/var/run/act/workflow/event.json","utf8"));
|
||||||
|
|
||||||
const repo =
|
const repo =
|
||||||
ev?.repository?.clone_url ||
|
ev?.repository?.clone_url ||
|
||||||
(ev?.repository?.html_url ? (ev.repository.html_url.replace(/\/$/,'') + ".git") : "");
|
(ev?.repository?.html_url ? (ev.repository.html_url.replace(/\/$/,'') + ".git") : "");
|
||||||
|
|
||||||
const sha =
|
const sha =
|
||||||
ev?.after ||
|
ev?.after ||
|
||||||
ev?.pull_request?.head?.sha ||
|
ev?.pull_request?.head?.sha ||
|
||||||
ev?.head_commit?.id ||
|
ev?.head_commit?.id ||
|
||||||
ev?.sha ||
|
ev?.sha ||
|
||||||
"";
|
"";
|
||||||
|
|
||||||
if (!repo) { console.error("No repository.clone_url/html_url in event.json"); process.exit(1); }
|
if (!repo) { console.error("No repository.clone_url/html_url in event.json"); process.exit(1); }
|
||||||
if (!sha) { console.error("No sha/after/pull_request.head.sha in event.json"); process.exit(1); }
|
if (!sha) { console.error("No sha/after/pull_request.head.sha in event.json"); process.exit(1); }
|
||||||
|
|
||||||
// print shell-safe assignments
|
|
||||||
console.log(`REPO_URL=${JSON.stringify(repo)}`);
|
console.log(`REPO_URL=${JSON.stringify(repo)}`);
|
||||||
console.log(`SHA=${JSON.stringify(sha)}`);
|
console.log(`SHA=${JSON.stringify(sha)}`);
|
||||||
NODE
|
NODE
|
||||||
@@ -70,6 +63,11 @@ NODE
|
|||||||
git checkout -q FETCH_HEAD
|
git checkout -q FETCH_HEAD
|
||||||
git log -1 --oneline
|
git log -1 --oneline
|
||||||
|
|
||||||
|
- name: Anchor aliases schema
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
node scripts/check-anchor-aliases.mjs
|
||||||
|
|
||||||
- name: NPM harden
|
- name: NPM harden
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -99,11 +97,6 @@ NODE
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
npm run test:anchors
|
npm run test:anchors
|
||||||
|
|
||||||
- name: Anchor aliases schema
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
node scripts/check-anchor-aliases.mjs
|
|
||||||
|
|
||||||
- name: Verify anchor aliases injected in dist
|
- name: Verify anchor aliases injected in dist
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|||||||
Reference in New Issue
Block a user