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

[Feature] Add trigger for user membership in a team. #346

Open
gagoar opened this issue Jan 24, 2021 · 0 comments · May be fixed by #374
Open

[Feature] Add trigger for user membership in a team. #346

gagoar opened this issue Jan 24, 2021 · 0 comments · May be fixed by #374
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@gagoar
Copy link
Owner

gagoar commented Jan 24, 2021

Description

It will be great to add a trigger to check if the user has a membership on a team or not.

the implementation is quiet simple,

try {
              const { data: { state } } = await github.teams.getMembershipForUserInOrg({
                org: context.repo.owner,
                team_slug: 'teamName',
                username: context.actor
              });
              return state == 'active';
            } catch (error) {
              return false;
            }
}

This will be awesome for not only using the trigger in combination with other triggers (for instance only trigger the action if the files included are matching and the user matches or not the team but also for triggering actions on memberships like add this label if certain user belongs or not to a team.

@cyamonide thoughts?

@gagoar gagoar added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jan 24, 2021
@gagoar gagoar mentioned this issue Jan 25, 2021
3 tasks
@gagoar gagoar linked a pull request Feb 17, 2021 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant