Run this action on a schedule to automatically remove inactive Copilot licenses. It also creates a report as a job summary and csv. In addition to this it can also deploy users from a CSV file. This is useful as you are adopting Copilot as it can help facilitate the process of adding users to your organization.
Create a workflow (eg: .github/workflows/copilot-license-management.yml). See Creating a Workflow file.
If you want to deploy users from a CSV file you will need to create a CSV file with the following columns:
organization
- The organization to add the user to deployment_group - An arbitrary group name used to track the deploymentslogin
- The user's GitHub Login name to addactivation_date
- The date the user should be activated (YYYY-MM-DD)
You will need to create a PAT(Personal Access Token) that has manage_billing:copilot access. If you are specifying an 'enterprise' rather than individual organizations you must also include the read:org and read:enterprise scopes. Add this PAT as a secret TOKEN so we can use it for input github-token, see Creating encrypted secrets for a repository.
If your organization has SAML enabled you must authorize the PAT, see Authorizing a personal access token for use with SAML single sign-on.
- uses: austenstone/[email protected]
name: Copilot Usage Report
on:
workflow_dispatch:
jobs:
run:
name: Copilot Usage Reports
runs-on: ubuntu-latest
steps:
- uses: austenstone/[email protected]
with:
github-token: ${{ secrets.<PAT> }}
csv: true
- uses: austenstone/[email protected]
id: copilot-job-summary
with:
name: copilot-usage-report