Skip to content

A GitHub Action to generate a report to retrieve pending and failed invitations for a GitHub cloud enterprise or organization.

License

Notifications You must be signed in to change notification settings

nicklegan/github-enterprise-invitation-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Enterprise Invitation Action

A GitHub Action to generate a report to retrieve pending and failed invitations for a GitHub cloud enterprise or organization.

Usage

name: Invitation Report

on:
  workflow_dispatch:
  schedule:
    # Runs on every Sunday at 00:00 UTC
    #
    #        ┌────────────── minute
    #        │ ┌──────────── hour
    #        │ │ ┌────────── day (month)
    #        │ │ │ ┌──────── month
    #        │ │ │ │ ┌────── day (week)
    - cron: '0 0 * * 0'

jobs:
  invitation-report:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Get invitation report
        uses: nicklegan/github-enterprise-invitation-action@v2.0.0
        with:
          token: ${{ secrets.ORG_TOKEN }}
        # org: ''
        # enterprise: ''
        # sort: 'created_at'
        # sort-order: 'desc'
        # json: 'false'

GitHub secrets

Name Value Required
ORG_TOKEN A repo, read:org and read:enterprise scoped Personal Access Token true
ACTIONS_STEP_DEBUG true Enables diagnostic logging false

💡 The read:enterprise scope is only needed when running the Action on the enterprise level.

💡 Disable token expiration to avoid failed workflow runs when running on a schedule.

💡 If the organization has SAML SSO enabled, make sure the personal access token is authorized to access the organization.

Action inputs

If the organization name in the workflow is left blank, the Action will generate a report for the organization the workflow is located in. If an enterprise slug is used in the workflow, this will supersede the organization parameter and the Action will run on the enterprise level instead.

Name Description Default Location Required
org Organization different than workflow context workflow.yml false
enterprise Enterprise slug, to retrieve invitations for the entire enterprise workflow.yml false
sort Sort the CSV report by column (select column in JSON format) created_at action.yml false
sort-order Sort CSV column order (ascending or descending) desc action.yml false
json Setting to generate an additional report in JSON format false workflow.yml false
committer-name The name of the committer that will appear in the Git history github-actions action.yml false
committer-email The committer email that will appear in the Git history github-actions@github.com action.yml false

💡 JSON column name details used for sorting CSV columns by key used in the workflow file are specified below.

CSV layout

CSV column JSON Description
Username login GitHub username
Email email Email address used for the invitation
State state Pending or failed state of the invitation
Created at created_at Date the invitation was created
Failed at failed_at Specifies the date if the invitation has failed
Org entOrg The organization the invitation was sent out for
Inviter inviter The user or account initiating the invitation

A CSV report file will be saved in the repository reports folder using the following naming format: organization/enterprise-invitations.csv.

About

A GitHub Action to generate a report to retrieve pending and failed invitations for a GitHub cloud enterprise or organization.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks