From 72d25f3048ebc4d895cb19e7d63e894d09327e5f Mon Sep 17 00:00:00 2001 From: David Vargas Date: Mon, 28 Nov 2022 11:56:45 -0500 Subject: [PATCH 1/2] update validate plugin entry to account for publishing on behalf of orgs --- .github/workflows/validate-plugin-entry.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-plugin-entry.yml b/.github/workflows/validate-plugin-entry.yml index 608289eacca..e1832d6ff42 100644 --- a/.github/workflows/validate-plugin-entry.yml +++ b/.github/workflows/validate-plugin-entry.yml @@ -50,7 +50,16 @@ jobs: console.log(`Repo info: ${owner}/${repo}`); if (owner.toLowerCase() !== author.toLowerCase()) { - addError(`The newly added entry is not at the end, or you are submitting on someone else's behalf. Last plugin in the list is: ${plugin.repo}`); + const onBehalfOfOrg = await octokit.rest.orgs + .checkMembershipForUser({ + org: owner.toLowerCase(), + username: author.toLowerCase(), + }) + .then(() => true) + .catch(() => false); + if (!onBehalfOfOrg) { + addError(`The newly added entry is not at the end, or you are submitting on someone else's behalf. Last plugin in the list is: ${plugin.repo}`); + } } else { try { await github.rest.repos.get({ owner, repo }); From f0e9049b866220729da469b3956a32b672774efc Mon Sep 17 00:00:00 2001 From: David Vargas Date: Mon, 28 Nov 2022 15:53:43 -0500 Subject: [PATCH 2/2] Update validate-plugin-entry.yml --- .github/workflows/validate-plugin-entry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-plugin-entry.yml b/.github/workflows/validate-plugin-entry.yml index e1832d6ff42..8591d764ff7 100644 --- a/.github/workflows/validate-plugin-entry.yml +++ b/.github/workflows/validate-plugin-entry.yml @@ -50,7 +50,7 @@ jobs: console.log(`Repo info: ${owner}/${repo}`); if (owner.toLowerCase() !== author.toLowerCase()) { - const onBehalfOfOrg = await octokit.rest.orgs + const onBehalfOfOrg = await github.rest.orgs .checkMembershipForUser({ org: owner.toLowerCase(), username: author.toLowerCase(),