This GitHub action is used to invite a user to an organisation. We use this action to invite all users that have sent a pull request that has been merged to Strawberry GraphQL.
This action is meant to run on pushes to the main branch and it will automatically find the PR that was merged and invite the user to the organisation.
organisation
: the name of the organisationteam-slug
: the slug of the team the user should be invited togithub-token
: the GitHub token, needs to have theadmin:org
scope andpublic_repo
permission in order to invite users and add a comment to the PR. This token should be generated by an owner of the organisation, otherwise you wouldn't be able to invite users.comment
: the comment that will be sent to the PR when the user is invited.
This action has no outputs. It will invite the user and send a comment to the PR that was merged.
name: Invite contributor
on:
push:
branches:
- main
jobs:
invite-contributor:
name: Invite contributor
runs-on: ubuntu-latest
steps:
- name: Invite contributor
uses: strawberry-graphql/invite-to-org-action@v1
with:
organisation: "strawberry-graphql"
comment: Thanks for contributing to Strawberry!
team-slug: "strawberry-contributors"
github-token: ${{ secrets.GITHUB_TOKEN }}