Giter Club home page Giter Club logo

github-org-repo-collaborator-action's Introduction

GitHub Organization Repository Collaborator Action

A GitHub Action to generate a report which contains repository collaborator details for a GitHub organization.

Usage

The example workflow below runs on a weekly schedule and can also be executed manually using a workflow_dispatch event.

name: Repo Collaborator Action

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

jobs:
  github-collaborator-report:
    runs-on: ubuntu-latest

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

      - name: Get repo collaborator report
        uses: nicklegan/[email protected]
        with:
          token: ${{ secrets.ORG_TOKEN }}
        # org: ''
        # affil: 'ALL'
        # permission: 'ADMIN'
        # days: '90'
        # json: 'FALSE'
        # appid: ${{ secrets.APPID }}
        # privatekey: ${{ secrets.PRIVATEKEY }}
        # installationid: ${{ secrets.INSTALLATIONID }}

GitHub secrets

Name Value Required
ORG_TOKEN A user:email, repo, admin:orgscoped Personal Access Token true
ACTIONS_STEP_DEBUG true Enables diagnostic logging false

💡 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.

Name Description Default Options Required
org Organization different than the default workflow context workflow.yml false
permission Permission to query for (ADMIN, MAINTAIN, WRITE, TRIAGE, READ, ALL) ADMIN workflow.yml false
affil Collaborator type to query for (ALL, DIRECT, OUTSIDE) ALL workflow.yml false
days Amount of days to look back for contributions 90 workflow.yml false
json Export 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 [email protected] action.yml false

CSV layout

Column Description
Repository Repository the user is a collaborator of
Repo Visibility Private, public or internal repository visibility
Username GitHub username
Full name GitHub profile name
SSO email GitHub NameID email (only available if org SSO setting is enabled)
Verified email GitHub verified domain email
Public email GitHub account email
Repo permission Repository permissions for the user
Organization role Whether the user is a member, admin (org owner) or outside collaborator
Active contributions If the user made contributions during the set interval
Total contributions Total number of organization contributions made by the user during the set interval
User created Date the user account was created
User updated Date the user account settings were last updated
Organization Organization the repo belongs to

💡 A CSV report file will be saved in the repository reports folder using the following naming format: organization-affil-permission-report.csv.

GitHub App authentication

As an option you can use GitHub App authentication to generate the report.

Register a new organization/personal owned GitHub App with the below permissions:

GitHub App Permission Access
Organization Permissions:Administration read
Organization Permissions:Members read
Repository Permissions:Contents read and write
User Permissions:Email addresses read

After registration install the GitHub App to your organization. Store the below App values as secrets.

GitHub App secrets

Name Value Required
APPID GitHub App ID number true
PRIVATEKEY Content of private key .pem file true
INSTALLATIONID GitHub App installation ID number true

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.