Skip to content

Commit 058219a

Browse files
TMHSDigitalclaude
andcommitted
release: no persisted token during the check suite (#251); contributor docs cover deprecations and spdx-allowed (#269)
- release.yml checks out with persist-credentials: false and hands the token only to the CITATION push step - CONTRIBUTING step 5, the status rule and the PR template say deprecating an entry needs npm run counts; the V6 messages say so too - a new licence also needs its SPDX id in site/spdx-allowed.json - releases run on Node 24; PRs and pushes on 24 and 22 Closes #251 Closes #269 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpkeXQPaUhxjgqdqnk6BrJ
1 parent 5996c95 commit 058219a

4 files changed

Lines changed: 16 additions & 10 deletions

File tree

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- [ ] `id` is unique across the whole catalog
1212
- [ ] Live license checked today; `## Evidence` has a dated line quoting it
1313
- [ ] Row added to the category `README.md`, with the same licence as the frontmatter
14-
- [ ] Ran `node site/sync-counts.mjs` after adding or removing entries
14+
- [ ] Ran `node site/sync-counts.mjs` after adding, removing or deprecating entries
1515
- [ ] Stacks: followed `stacks/README.md`; no licence named in a stack's own words
1616
- [ ] `npm test && npm run validate` passes locally (CI runs the full `npm run check`: see [What CI runs](https://github.com/TMHSDigital/Free-Game-Dev-Assets/blob/main/CONTRIBUTING.md#what-ci-runs))
1717
- [ ] If I publish the source, I say so above; if an agent or script drafted this, every licence fact was still read at the source by me

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
with:
3838
# The sitemap's lastmod dates come from git history.
3939
fetch-depth: 0
40+
# No token in .git/config while npm run check executes repo code;
41+
# only the CITATION push below gets one (#251).
42+
persist-credentials: false
4043

4144
- name: Setup Node
4245
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
@@ -71,6 +74,8 @@ jobs:
7174
7275
- name: Write the version into CITATION.cff
7376
if: steps.tag.outputs.skip != 'true'
77+
env:
78+
GH_TOKEN: ${{ github.token }}
7479
run: |
7580
node - <<'JS'
7681
const fs = require("node:fs");
@@ -91,7 +96,7 @@ jobs:
9196
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
9297
git add CITATION.cff
9398
git commit -m "Release $CATALOG_VERSION: record the version in CITATION.cff"
94-
git push origin HEAD:main
99+
git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:main
95100
fi
96101
97102
- name: Create the release

‎CONTRIBUTING.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The website rebuilds from frontmatter on deploy. Node 22 or newer is all you nee
3636
2. Verify the license on the live source page the day you submit, and fill every frontmatter field from it (rules below). Prefer primary URLs over mirror/aggregator pages.
3737
3. Write the body: a one-paragraph summary, `## Notes`, `## Evidence` with a dated line quoting the source, such as `- Live page (2026-09-25): "Free for commercial use"`, and optionally `## Related` linking sibling entries. Every Evidence section needs at least one date, and `verified` may not be newer than the newest one. The template (and so the scaffold) starts at `status: needs-review`; set `active` once the licence, the commercial stance and the credit requirement are all settled.
3838
4. Add a row to the matching category `README.md`. This is required: the validator fails an entry that is not listed there, and the row's licence cell must match your frontmatter.
39-
5. Run `node site/sync-counts.mjs` (`npm run counts`). It updates every place the repo restates the entry count: both category count tables, the README badge and "Browse N sources" line, and `expectedEntryCount` in [`site/config.json`](site/config.json).
39+
5. Run `node site/sync-counts.mjs` (`npm run counts`) whenever you add, remove or deprecate an entry: the counts include listed entries only, so `status: deprecated` changes them too. It updates every place the repo restates the entry count: both category count tables, the README badge and "Browse N sources" line, and `expectedEntryCount` in [`site/config.json`](site/config.json).
4040
6. Run `npm test && npm run validate` before you push; that is quick. CI then runs `npm run check` (the steps are listed under [What CI runs](#what-ci-runs)), and all of it must pass. Run `npm run check` yourself if you changed the site or want to preview your entry's page. The build renders your entry's page and fails if the body uses markdown the site does not support (tables, code fences, blockquotes, images, raw HTML, `###` headings, numbered lists) or links to a file that does not exist.
4141
7. Save files with LF line endings. `.editorconfig` and `.gitattributes` take care of it in most editors; the validator rejects a file that still contains a CR.
4242
8. Optional: add the `id` to `site/config.json` → `featured` to pin it under Safe starting points.
@@ -45,7 +45,7 @@ To add a starter stack (one pick per need for a kind of game), follow [`stacks/R
4545

4646
### Frontmatter rules
4747

48-
- `license`: the source's licence, written as one of the values in [`site/license-vocabulary.json`](site/license-vocabulary.json) (e.g. `CC0`, `CC-BY-3.0`, `SIL OFL`, `GPL-3.0-or-later`, `custom`, `varies`). If the source uses a licence the vocabulary lacks, add it there first, with its SPDX mapping and attribution class. For GPL, record `-only` or `-or-later` only when the project itself says which; otherwise use the bare `GPL-2.0` or `GPL-3.0`.
48+
- `license`: the source's licence, written as one of the values in [`site/license-vocabulary.json`](site/license-vocabulary.json) (e.g. `CC0`, `CC-BY-3.0`, `SIL OFL`, `GPL-3.0-or-later`, `custom`, `varies`). If the source uses a licence the vocabulary lacks, add it there first, with its SPDX mapping and attribution class, and add the SPDX id to [`site/spdx-allowed.json`](site/spdx-allowed.json); the validator rejects any `license_spdx` missing from that list. For GPL, record `-only` or `-or-later` only when the project itself says which; otherwise use the bare `GPL-2.0` or `GPL-3.0`.
4949
- `license_spdx`: the SPDX identifier the vocabulary maps your `license` to. The validator rejects a missing one when a mapping exists, and an invented one when it does not.
5050
- `commercial`: `true` / `false` / `unknown` / `varies`. Use `varies` for aggregators where some files are commercial-ok and others are not. The site still shows these under Commercial OK, labeled **per-file review**, so they are not silently excluded and not silently treated as a blanket grant.
5151
- `attribution_required`: `true` / `false` / `unknown`. If the licence normally requires credit (CC-BY) but the publisher waives it, set `false` and add a `- Attribution waived:` line in Notes saying so. The validator requires that waiver to be quoted on a dated Evidence line (V38).
@@ -65,12 +65,12 @@ To add a starter stack (one pick per need for a kind of game), follow [`stacks/R
6565
- `url`: an `https://` address (`http://` only where the source has no https). Other schemes are rejected.
6666
- `added`: ISO date (`YYYY-MM-DD`) the entry joined the catalog. `npm run new-entry` fills it in; it never changes afterwards (V26: a real date, not in the future). The "new sources" feed and the home page's "New in the last 30 days" line key on it, so a re-verification sweep does not look like a wave of new entries. Moving an entry to another category keeps its date: `npm run check-added` (run in CI) fails when `added` is later than the file's first commit, following renames.
6767
- `verified`: ISO date (`YYYY-MM-DD`) of your last license check. It must be a real date, no later than tomorrow in UTC, and no newer than the newest date in `## Evidence` (V8): a new `verified` date needs a new dated Evidence line from the same check. Dates inside URLs do not count as Evidence dates.
68-
- `status`: `active` | `needs-review` | `deprecated`. A `deprecated` entry needs a `- Deprecated:` line in its body giving the reason (V9). `active` means the licence, the commercial stance and the credit requirement are all settled: an `unknown` in `license`, `commercial` or `attribution_required` keeps an entry at `needs-review`. The validator enforces this (V14), and rejects `formats`, `subcategories` or `tags` values that differ only by case, punctuation or a trailing "s" from one already in use (V13).
68+
- `status`: `active` | `needs-review` | `deprecated`. A `deprecated` entry needs a `- Deprecated:` line in its body giving the reason (V9), and `npm run counts` afterwards, since deprecated entries leave the counts (V6). `active` means the licence, the commercial stance and the credit requirement are all settled: an `unknown` in `license`, `commercial` or `attribution_required` keeps an entry at `needs-review`. The validator enforces this (V14), and rejects `formats`, `subcategories` or `tags` values that differ only by case, punctuation or a trailing "s" from one already in use (V13).
6969
- No other keys. An unknown key is rejected with the nearest allowed one (V33): `id`, `name`, `url`, `publisher`, `category`, `subcategories`, `license`, `license_spdx`, `commercial`, `attribution_required`, `attribution_string`, `formats`, `tags`, `added`, `verified`, `status`, `engine_lock`, `ue_versions`, `camera_perspective`, `grid_dimensions`, `maintenance`, `hardware_tags`, `preview` and `limits`. A typo such as `engine-lock` would otherwise drop the fact silently. Block-list items are indented under their key (` - item`), and every key needs a space after its colon.
7070

7171
## What CI runs
7272

73-
Every pull request, every push to `main` (before the site deploys) and every release run one sequence, `npm run check` in [`package.json`](package.json), on Node 24 and again on Node 22:
73+
Every pull request, every push to `main` (before the site deploys) and every release run one sequence, `npm run check` in [`package.json`](package.json). Pull requests and pushes run it on Node 24 and again on Node 22; releases run it on Node 24:
7474

7575
1. `npm run lint` (`site/lint.mjs`): every script parses, and none imports a name it does not use.
7676
2. `npm test`: the checks against known-bad fixtures (`site/checks.test.mjs`) and the site modules' tests (`site/lib/lib.test.mjs`).

‎site/checks.mjs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ export function markdownAnchors(text) {
10011001
* README source-count badge and link text, all restate numbers the catalog
10021002
* already knows. They are correct today and drift on the next addition.
10031003
*/
1004+
const COUNTS_HINT = " (counts include listed entries only, so adding, removing or deprecating one changes them: run npm run counts)";
10041005
export function checkCountTables(measured, docs) {
10051006
const errors = [];
10061007
const total = Object.values(measured).reduce((a, b) => a + b, 0);
@@ -1017,7 +1018,7 @@ export function checkCountTables(measured, docs) {
10171018
}
10181019
if (Number(m[1]) !== count) {
10191020
errors.push(
1020-
`${name} lists ${m[1]} entries for "${cat}" but the catalog has ${count}`
1021+
`${name} lists ${m[1]} entries for "${cat}" but the catalog has ${count}${COUNTS_HINT}`
10211022
);
10221023
}
10231024
}
@@ -1029,20 +1030,20 @@ export function checkCountTables(measured, docs) {
10291030
if (!badge) errors.push("README.md has no sources-<count> badge");
10301031
else if (Number(badge[1]) !== total) {
10311032
errors.push(
1032-
`README.md sources badge says ${badge[1]} but the catalog has ${total}`
1033+
`README.md sources badge says ${badge[1]} but the catalog has ${total}${COUNTS_HINT}`
10331034
);
10341035
}
10351036
const browse = readme.text.match(/Browse (\d+) sources/);
10361037
if (!browse) errors.push('README.md has no "Browse <count> sources" link');
10371038
else if (Number(browse[1]) !== total) {
10381039
errors.push(
1039-
`README.md "Browse ${browse[1]} sources" but the catalog has ${total}`
1040+
`README.md "Browse ${browse[1]} sources" but the catalog has ${total}${COUNTS_HINT}`
10401041
);
10411042
}
10421043
// Optional wording; checked wherever it appears.
10431044
for (const m of readme.text.matchAll(/searches all (\d+) entries/g)) {
10441045
if (Number(m[1]) !== total) {
1045-
errors.push(`README.md "searches all ${m[1]} entries" but the catalog has ${total}`);
1046+
errors.push(`README.md "searches all ${m[1]} entries" but the catalog has ${total}${COUNTS_HINT}`);
10461047
}
10471048
}
10481049
}

0 commit comments

Comments
 (0)