Don't treat Dependabot as community contributor (https://github.com/woocommerce/woocommerce-blocks/pull/9254)
* Test commit * Don't treat dependabot as a community * Remove unwanted change * Make the check for ignored usernames clearer
This commit is contained in:
parent
eec844f447
commit
115ccca4f9
|
@ -6,6 +6,10 @@ const core = require( '@actions/core' );
|
||||||
// this won't work.
|
// this won't work.
|
||||||
const octokit = new Octokit();
|
const octokit = new Octokit();
|
||||||
|
|
||||||
|
const ignoredUsernames = [ 'dependabot' ];
|
||||||
|
const checkIfIgnoredUsername = ( username ) =>
|
||||||
|
ignoredUsernames.includes( username );
|
||||||
|
|
||||||
const getIssueAuthor = ( payload ) => {
|
const getIssueAuthor = ( payload ) => {
|
||||||
return (
|
return (
|
||||||
payload?.issue?.user?.login ||
|
payload?.issue?.user?.login ||
|
||||||
|
@ -15,7 +19,7 @@ const getIssueAuthor = ( payload ) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const isCommunityContributor = async ( owner, repo, username ) => {
|
const isCommunityContributor = async ( owner, repo, username ) => {
|
||||||
if ( username ) {
|
if ( username && ! checkIfIgnoredUsername( username ) ) {
|
||||||
const {
|
const {
|
||||||
data: { permission },
|
data: { permission },
|
||||||
} = await octokit.rest.repos.getCollaboratorPermissionLevel( {
|
} = await octokit.rest.repos.getCollaboratorPermissionLevel( {
|
||||||
|
|
Loading…
Reference in New Issue