A Github action to manage organization and teams membership using pull requests.
This action will compare the contents of the .github/organization/members.yml
file of your repository with the actual
membership of the containing organization and invite newly defined members or remove deleted members.
Supported member types:
- admin
- member
- Github member invitees
billing_manager
, hiring_manager
, reinstate
) that are not
direct members and non-Github invitees.
Of course, this will only work for organization-owned repositories.
This action will skip on any event other than push.
This action has no input.
This action has no output
The Github membership management endpoints require a personal access token.
Create a new one and create a new secret named ORG_MEMBERSHIP_MANAGEMENT_TOKEN
in your repository
with the value of your new personal access token.
jobs:
manage:
name: Manage organization membership
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Manage organization membership
uses: johnmartel/organization-membership-action@v1
env:
ORG_MEMBERSHIP_MANAGEMENT_TOKEN: ${{ secrets.ORG_MEMBERSHIP_MANAGEMENT_TOKEN }}
This action will only fire if .github/organization/members.yml
has been modified in the triggering event.
This file defines the required members for your organization when this action completes successfully. The expected format is:
members:
- name: johnmartel
role: admin
- name: sebasrobert
role: member
The roles are defined in the API documentation.
In order to prevent accidental deletion of all organization members, this action will ignore an empty members file and exit with failure.
npm run lint
npm test
npm run build:clean
docker build .