Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa279c31f1 | ||
|
|
67a1b48394 | ||
|
|
9c7eec883c | ||
|
|
73f8e1602f | ||
|
|
68c9f42aed | ||
|
|
ddcb5679ba | ||
|
|
c9159ff1bf | ||
|
|
41709bec46 | ||
|
|
30afa8b630 |
No files matched your search
@@ -0,0 +1,57 @@
|
|||||||
|
name: Dependency audit
|
||||||
|
|
||||||
|
# Weekly, on GITEA ONLY — this is maintenance, so it belongs in the internal tracker.
|
||||||
|
#
|
||||||
|
# This is the counterpart that makes release.yml's relaxed gate safe rather than
|
||||||
|
# negligent. Advisories still get found; they just arrive as an issue on Monday
|
||||||
|
# morning instead of as a failed release on a Friday afternoon. Learning about a
|
||||||
|
# vulnerability and being unable to publish should not be the same event.
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 13 * * 1' # Mondays, 07:00 America/Mexico_City
|
||||||
|
workflow_dispatch: # so it can be run — and tested — on demand
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
audit:
|
||||||
|
if: ${{ github.server_url != 'https://github.com' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '22'
|
||||||
|
- run: npm ci
|
||||||
|
|
||||||
|
- name: Audit
|
||||||
|
id: audit
|
||||||
|
run: |
|
||||||
|
if npm audit --audit-level=moderate > audit.txt 2>&1; then
|
||||||
|
echo 'clean=true' >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo 'clean=false' >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
cat audit.txt
|
||||||
|
|
||||||
|
- name: File an issue
|
||||||
|
if: steps.audit.outputs.clean == 'false'
|
||||||
|
env:
|
||||||
|
GT_TOKEN: ${{ github.token }}
|
||||||
|
API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}
|
||||||
|
TITLE: 'Dependency advisories: npm audit is failing'
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
# One open issue at a time. A weekly cron must not file 52 duplicates.
|
||||||
|
open=$(curl -sSL -H "Authorization: token $GT_TOKEN" \
|
||||||
|
"$API/issues?state=open&type=issues" \
|
||||||
|
| jq --arg t "$TITLE" '[.[] | select(.title == $t)] | length')
|
||||||
|
if [ "$open" != "0" ]; then
|
||||||
|
echo "An issue is already open. Nothing to file."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
body=$(printf '`npm audit --audit-level=moderate` failed on the scheduled run.\n\nThe release gate does not fail on this by design — see the comment in `release.yml`. A static site ships built HTML, not `node_modules`, so a build-time advisory does not reach a visitor. This issue is how it reaches you instead.\n\nFix it in a normal PR, on your own schedule.\n\n```\n%s\n```\n' "$(head -c 4000 audit.txt)")
|
||||||
|
|
||||||
|
jq -n --arg t "$TITLE" --arg b "$body" '{title: $t, body: $b}' \
|
||||||
|
| curl -sS -X POST -H "Authorization: token $GT_TOKEN" \
|
||||||
|
-H 'Content-Type: application/json' -d @- "$API/issues" > /dev/null
|
||||||
|
echo "Issue filed."
|
||||||
@@ -24,7 +24,15 @@ jobs:
|
|||||||
- name: Validate release tag
|
- name: Validate release tag
|
||||||
run: npm run verify:release
|
run: npm run verify:release
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm audit --audit-level=moderate
|
# Deliberately `critical`, not `moderate`. npm audit reads a live advisory feed,
|
||||||
|
# so a release gated on it fails by calendar date rather than by anything the
|
||||||
|
# release changed — and it fails at the exact moment there is least time to judge
|
||||||
|
# whether a fix is safe. What ships here is built HTML, CSS and JS: Astro, js-yaml
|
||||||
|
# and friends are build-time tools that never reach a visitor. `critical` keeps a
|
||||||
|
# tripwire for the catastrophic case without breaking releases on routine noise.
|
||||||
|
# Moderate and up still gate every PR in ci.yml, and audit.yml files an issue on a
|
||||||
|
# schedule, so advisories still surface — just not as a broken release.
|
||||||
|
- run: npm audit --audit-level=critical
|
||||||
- run: npm run check
|
- run: npm run check
|
||||||
- name: Package dist/
|
- name: Package dist/
|
||||||
run: tar -czf "$ARCHIVE_NAME" -C dist .
|
run: tar -czf "$ARCHIVE_NAME" -C dist .
|
||||||
@@ -33,4 +41,5 @@ jobs:
|
|||||||
- name: Attach to GitHub release
|
- name: Attach to GitHub release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
|
prerelease: true
|
||||||
files: ${{ env.ARCHIVE_NAME }}
|
files: ${{ env.ARCHIVE_NAME }}
|
||||||
Generated
+3
-15
@@ -76,9 +76,6 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -95,9 +92,6 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -114,9 +108,6 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -133,9 +124,6 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -3456,9 +3444,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/js-yaml": {
|
"node_modules/js-yaml": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
|
||||||
"integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==",
|
"integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import { readFile } from 'node:fs/promises';
|
||||||
|
import test from 'node:test';
|
||||||
|
|
||||||
|
test('publishes beta tags as GitHub prereleases', async () => {
|
||||||
|
const workflow = await readFile(new URL('../.github/workflows/release.yml', import.meta.url), 'utf8');
|
||||||
|
|
||||||
|
assert.match(
|
||||||
|
workflow,
|
||||||
|
/uses: softprops\/action-gh-release@v2[\s\S]*?with:\s*\n\s+prerelease: true\s*\n\s+files:/,
|
||||||
|
);
|
||||||
|
});
|
||||||
@@ -89,6 +89,12 @@ const serializedStructuredData = structuredData
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<meta name="generator" content={Astro.generator} />
|
<meta name="generator" content={Astro.generator} />
|
||||||
|
|
||||||
|
{/* GoatCounter — no cookies, no personal data, no consent banner needed. */}
|
||||||
|
<script
|
||||||
|
data-goatcounter="https://greentea.goatcounter.com/count"
|
||||||
|
async
|
||||||
|
src="//gc.zgo.at/count.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<Header />
|
<Header />
|
||||||
|
|||||||
Reference in new issue
Block a user