Skip to content

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

@gagoar

Description

@gagoar

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions