From f8be2d48ac5f55fd647b801f53f28755bb3299b5 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 17 Jul 2024 23:22:18 +0200 Subject: [PATCH] fixup! tools: add workflow to ensure `README` lists are in sync with gh teams do not error out if secret is missing --- .github/workflows/linters-readme.yml | 10 ++++++---- tools/lint-readme-lists.mjs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linters-readme.yml b/.github/workflows/linters-readme.yml index 55872a3370d724..4dfba00fb931af 100644 --- a/.github/workflows/linters-readme.yml +++ b/.github/workflows/linters-readme.yml @@ -32,12 +32,14 @@ jobs: get_list_members() { TEAM="$1" QUOTE='"' - gh api "/orgs/$GITHUB_REPOSITORY_OWNER/teams/$TEAM/members" -X GET -f per_page=100 --jq "map(.login) | ${QUOTE}${TEAM}=\(tojson)${QUOTE}" + gh api "/orgs/nodejs/teams/$TEAM/members" -X GET -f per_page=100 --jq "map(.login) | ${QUOTE}${TEAM}=\(tojson)${QUOTE}" } - get_list_members "collaborators" >> "$GITHUB_OUTPUT" - get_list_members "issue-triage" >> "$GITHUB_OUTPUT" - get_list_members "tsc" >> "$GITHUB_OUTPUT" + [ -z "$GITHUB_TOKEN" ] || ( + get_list_members "collaborators" + get_list_members "issue-triage" + get_list_members "tsc" + ) >> "$GITHUB_OUTPUT" env: GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} - name: Get modified README diff --git a/tools/lint-readme-lists.mjs b/tools/lint-readme-lists.mjs index 607c46127c0510..f6c05b46bdf20f 100755 --- a/tools/lint-readme-lists.mjs +++ b/tools/lint-readme-lists.mjs @@ -67,7 +67,7 @@ console.info('Lists are in the alphabetical order.'); assert.deepStrictEqual(tscMembers, new Set(), 'Some TSC members are not listed as Collaborators'); -if (argv[2]) { +if (argv[2] && argv[2] !== '{}') { const reviver = (_, value) => (typeof value === 'string' && value[0] === '[' && value.at(-1) === ']' ? new Set(JSON.parse(value)) :