Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Manage your Github organization/teams membership with pull requests!

License

Notifications You must be signed in to change notification settings

johnmartel/organization-membership-action

Repository files navigation

organization-membership-action

Maintainability codecov PRs Welcome

A Github action to manage organization and teams membership using pull requests.

Usage

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

⚠️ This action does not support non-owner members (i.e. billing_manager, hiring_manager, reinstate) that are not direct members and non-Github invitees.

Of course, this will only work for organization-owned repositories.

Trigger

This action will skip on any event other than push.

Inputs

This action has no input.

Outputs

This action has no output

Secrets

ORG_MEMBERSHIP_MANAGEMENT_TOKEN

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.

Example usage

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 }}

.github/organization/members.yml

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.

Building

npm run lint
npm test
npm run build:clean
docker build .

About

Manage your Github organization/teams membership with pull requests!

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published