Skip to content

Commit 5370926

Browse files
committed
fixup! tools: add workflow to ensure README lists are in sync with gh teams
1 parent 7d5bb3b commit 5370926

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

.github/workflows/linters-readme.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: Linters (README.md)
44

55
on:
6-
# We need `pull_request_target` to access the secrets
6+
# We need `pull_request_target`, because forks won't have access to team members.
77
pull_request_target:
88
types: [opened, synchronize, reopened, ready_for_review]
99
paths: [README.md]
@@ -15,10 +15,6 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1616
cancel-in-progress: true
1717

18-
env:
19-
PYTHON_VERSION: '3.12'
20-
NODE_VERSION: lts/*
21-
2218
permissions:
2319
contents: read
2420

tools/lint-readme-lists.mjs

+10-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@ for await (const line of readme.readLines()) {
6363
previousGithubHandle = currentGithubHandleLowerCase;
6464
}
6565
}
66+
console.info('Lists are in the alphabetical order.');
6667

6768
assert.deepStrictEqual(tscMembers, new Set(), 'Some TSC members are not listed as Collaborators');
6869

69-
const reviver = (_, value) =>
70-
(typeof value === 'string' && value[0] === '[' && value.at(-1) === ']' ?
71-
new Set(JSON.parse(value)) :
72-
value);
73-
assert.deepStrictEqual({ ...actualMembers }, JSON.parse(argv[2], reviver));
70+
if (argv[2]) {
71+
const reviver = (_, value) =>
72+
(typeof value === 'string' && value[0] === '[' && value.at(-1) === ']' ?
73+
new Set(JSON.parse(value)) :
74+
value);
75+
assert.deepStrictEqual(JSON.parse(argv[2], reviver), { ...actualMembers });
76+
} else {
77+
console.warn('Skipping the check of GitHub teams membership.');
78+
}

0 commit comments

Comments
 (0)