paritytech / opstooling-js

Shared functionality for OpsTooling projects
https://www.npmjs.com/package/@eng-automation/js
Apache License 2.0
0 stars 1 forks source link

Introduce isGithubOrganizationMember #8

Closed joao-paulo-parity closed 2 years ago

joao-paulo-parity commented 2 years ago

Multiple bots deal with commands and need to check organization membership, e.g.

https://github.com/paritytech/command-bot/blob/a7a73e6be1a384364c92c0151c228d3229e1f42e/src/core.ts#L57

https://gitlab.parity.io/parity/opstooling/cla-bot-2021/-/blob/ade6c3d94deec032aacc7cf21573420f30e4f7f7/src/github.ts#L618

https://github.com/paritytech/gitspiegel/pull/80/files#diff-033ecd338eec0994fe53c0896219baee901e20068b8fbe6259a23d5759584b06R705

Thus it makes sense to introduce a isGithubOrganizationMember to github.ts.


After introducing isGithubOrganizationMember, the github.ts module hosted two very different things (Octokit + isGithubOrganizationMember so it made sense to move Octokit to ./github/octokit.ts.


This PR is tagged as v0.0.5-pre.