Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update validate plugin entry to account for publishing on behalf of orgs #1376

Merged
merged 2 commits into from Nov 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/validate-plugin-entry.yml
Expand Up @@ -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 github.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 });
Expand Down