Skip to content

Export the Copilot for Business seat assignments for an organization that are currently being billed

License

Notifications You must be signed in to change notification settings

procter-gamble/copilot-usage-report

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copilot Usage Report

Export the Copilot for Business seat assignments for an organization that are currently being billed

Note: 1-Aug-2023 This Action uses the Copilot for Business API, which is in public Beta and subject to change

PAT Token

Create a Fine-grained personal access tokens with

  • Resource owner as Organization
  • read & write access to GitHub Copilot for Business under Organization permissions Screenshot 2023-08-01 at 4 09 43 PM

Pass this token as an input to the action - GITHUB_TOKEN

Action in workflow

Include the copilot-usage-report action in your workflow.

1. Sample workflow 1: Export to CSV

    name: Copilot Usage Report export to CSV 

    on:
      workflow_dispatch:

    jobs:
      first-job:
        runs-on: ubuntu-latest
        
        steps:
        - name: Copilot usage
            uses: ambilykk/copilot-usage-report@main
            with:        
            GITHUB_TOKEN: ${{secrets.ORG_TOKEN}}
            org_name: 'octodemo'
            file_path: data/Copilot-Usage-Report.csv
        
        - name: Upload Copilot Usage Report
            uses: actions/upload-artifact@v3
            with:
            name: Copilot Usage Report
            path: data/Copilot-Usage-Report.csv      

1. Sample workflow 2: Export to JSON

    name: Copilot Usage Report export to JSON

    on:
      workflow_dispatch:

    jobs:
      first-job:
        runs-on: ubuntu-latest
        
        steps:
        - name: Copilot usage
            uses: ambilykk/copilot-usage-report@main
            with:        
            GITHUB_TOKEN: ${{secrets.ORG_TOKEN}}
            org_name: 'octodemo'
            file_path: data/Copilot-Usage-Report.json
        
        - name: Upload Copilot Usage Report
            uses: actions/upload-artifact@v3
            with:
            name: Copilot Usage Report
            path: data/Copilot-Usage-Report.json      

Parameters

Name Required Description
GITHUB_TOKEN Yes PAT Token for access
org_name Yes GitHub Organization Name
file_path Yes CSV or JSON file path

Exported Fields

Following fields are included in the Copilot Usage Report

  • User
  • Created At
  • Updated At
  • Last Acivity At
  • Last Acivity Editor
  • Pending Cancellation Date
  • Team

Report

Copilot usage report is added as a build artifact in the workflow. You can download the report from the workflow run page.

Screenshot 2023-08-01 at 4 14 10 PM

License

The scripts and documentation in this project are released under the MIT License

About

Export the Copilot for Business seat assignments for an organization that are currently being billed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%