You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-29Lines changed: 43 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,13 @@ Run this action on a schedule to automatically remove inactive Copilot licenses.
5
5
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.
6
6
7
7
## Usage
8
+
8
9
Create a workflow (eg: `.github/workflows/copilot-license-management.yml`). See [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
9
10
10
11
### Deploying users from a CSV file
11
12
12
13
If you want to deploy users from a CSV file you will need to create a CSV file with the following columns:
14
+
13
15
-`organization` - The organization to add the user to
14
16
-`deployment_group` - An arbitrary group name used to track the deployments
15
17
-`login` - The user's GitHub Login name to add
@@ -29,15 +31,18 @@ If you are using Enterprise Managed Users, it may be easier to use a group from
29
31
30
32
### PAT(Personal Access Token)
31
33
32
-
You will need to [create a PAT(Personal Access Token)](https://github.com/settings/tokens/new?scopes=manage_billing:copilot) 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.
34
+
You will need to [create a PAT(Personal Access Token)](https://github.com/settings/tokens/new?scopes=manage_billing:copilot) 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.
35
+
36
+
If you are including external identities to the output must also include the `read:org` and `user:email` scopes.
37
+
38
+
Add this PAT as a secret `TOKEN` so we can use it for input `github-token`, see [Creating encrypted secrets for a repository](https://docs.github.com/en/enterprise-cloud@latest/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository).
33
39
34
-
Add this PAT as a secret `TOKEN` so we can use it for input `github-token`, see [Creating encrypted secrets for a repository](https://docs.github.com/en/enterprise-cloud@latest/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository).
35
40
### Organizations
36
41
37
42
If your organization has SAML enabled you must authorize the PAT, see [Authorizing a personal access token for use with SAML single sign-on](https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).
| inactive-seat-count | The number of inactive seats |
172
-
| removed-seats | The number of seats removed |
173
-
| seat-count | The total number of seats |
174
-
| deployed-seats | JSON array of deployed seats |
184
+
| removed-seats | The number of seats removed |
185
+
| seat-count | The total number of seats |
186
+
| deployed-seats | JSON array of deployed seats |
175
187
| deployed-seat-count | The number of deployed seats |
176
188
177
189
## How does it work?
190
+
178
191
We're simply leveraging the [GitHub Copilot API](https://docs.github.com/en/rest/copilot). First we fetch all the Copilot seats and filter them to only inactive seats. Then if the seat is assigned directly we remove it but if it's assigned through a team we remove the user from the team. Those inactive users are reported as a CSV and a job summary table.
179
192
180
193
## Further help
194
+
181
195
To get more help on the Actions see [documentation](https://docs.github.com/en/actions).
0 commit comments