{"id":16123589,"url":"https://github.com/austenstone/copilot-usage","last_synced_at":"2025-10-12T15:35:40.331Z","repository":{"id":235519023,"uuid":"790850694","full_name":"austenstone/copilot-usage","owner":"austenstone","description":"Create copilot usage reports as job summaries, and much more!","archived":false,"fork":false,"pushed_at":"2025-10-10T04:17:48.000Z","size":43376,"stargazers_count":19,"open_issues_count":12,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-12T15:35:37.112Z","etag":null,"topics":["copilot","copilot-chat","report","usage"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/austenstone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["austenstone"]}},"created_at":"2024-04-23T16:37:32.000Z","updated_at":"2025-10-05T11:25:57.000Z","dependencies_parsed_at":"2024-06-03T16:48:04.564Z","dependency_job_id":"df06148d-d1c9-4846-9c5a-ed2b8a9600f5","html_url":"https://github.com/austenstone/copilot-usage","commit_stats":null,"previous_names":["austenstone/copilot-usage"],"tags_count":13,"template":false,"template_full_name":"austenstone/action-typescript","purl":"pkg:github/austenstone/copilot-usage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fcopilot-usage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fcopilot-usage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fcopilot-usage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fcopilot-usage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austenstone","download_url":"https://codeload.github.com/austenstone/copilot-usage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fcopilot-usage/sbom","scorecard":{"id":1238746,"data":{"date":"2025-10-07T07:26:19Z","repo":{"name":"github.com/austenstone/copilot-usage","commit":"f2377ac23ac109e9f703dd5c012ae763cb8d3fc5"},"scorecard":{"version":"v5.2.1","commit":"ab2f6e92482462fe66246d9e32f642855a691dc1"},"score":6.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#code-review"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dependency-update-tool"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/scorecards.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/scorecards.yml:30","Info: jobLevel 'issues' permission set to 'read': .github/workflows/scorecards.yml:32","Info: jobLevel 'pull-requests' permission set to 'read': .github/workflows/scorecards.yml:33","Info: jobLevel 'checks' permission set to 'read': .github/workflows/scorecards.yml:35","Info: topLevel 'contents' permission set to 'read': .github/workflows/ci.yml:12","Info: topLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:13","Info: topLevel 'contents' permission set to 'read': .github/workflows/email.yml:7","Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:18","Info: topLevel permissions set to 'read-all': .github/workflows/scorecards.yml:18","Info: topLevel 'contents' permission set to 'read': .github/workflows/usage-team.yml:9","Info: topLevel 'contents' permission set to 'read': .github/workflows/usage.yml:13","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/austenstone/copilot-usage/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/austenstone/copilot-usage/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/email.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/austenstone/copilot-usage/email.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/email.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/austenstone/copilot-usage/email.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/email.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/austenstone/copilot-usage/email.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/usage-team.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/austenstone/copilot-usage/usage-team.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/usage-team.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/austenstone/copilot-usage/usage-team.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/usage.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/austenstone/copilot-usage/usage.yml/main?enable=pin","Info:   8 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   4 out of   8 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#license"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#cii-best-practices"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-g4jq-h2w9-997c","Warn: Project is vulnerable to: GHSA-jqfw-vq24-v9c3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: all commits (25) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#sast"}},{"name":"Security-Policy","score":9,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/austenstone/.github/SECURITY.md:1","Info: Found linked content: github.com/austenstone/.github/SECURITY.md:1","Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy","Info: Found text in security policy: github.com/austenstone/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#security-policy"}},{"name":"Contributors","score":10,"reason":"project has 15 contributing companies or organizations","details":["Info: found contributions from: docs, dsp-testing, github, github-fieldservices-planning, github-interviews, githubcustomers, githubtraining, microsoft, octodemo, octodemo-enablement, octodemo-resources, ps-resources, se-saml, skills, telit"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#contributors"}},{"name":"CI-Tests","score":10,"reason":"9 out of 9 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#ci-tests"}}]},"last_synced_at":"2025-10-12T15:35:38.746Z","repository_id":235519023,"created_at":"2025-10-12T15:35:38.746Z","updated_at":"2025-10-12T15:35:38.746Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011849,"owners_count":26085004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["copilot","copilot-chat","report","usage"],"created_at":"2024-10-09T21:17:33.100Z","updated_at":"2025-10-12T15:35:40.326Z","avatar_url":"https://github.com/austenstone.png","language":"TypeScript","readme":"# Copilot Usage Action\n\nhttps://github.com/user-attachments/assets/23bfb179-6e12-4db5-9ec6-be0019a692f8\n\nGet Copilot usage data as:\n* Md Job Summary\n* CSV\n* XML\n* JSON\n\nPowered by the [REST API endpoints for GitHub Copilot usage metrics](https://docs.github.com/en/rest/copilot/copilot-usage).\n\n\u003e [!TIP]\n\u003e 🚀 Get this running FAST by using the [template](https://github.com/austenstone/copilot-usage-template)\n\n## Usage\nCreate a workflow (eg: `.github/workflows/copilot-usage.yml`). See [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).\n\n### PAT(Personal Access Token)\n\nYou will need to [create a PAT(Personal Access Token)](https://github.com/settings/tokens/new?scopes=manage_billing:copilot) that has the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.\n\nAdd this PAT as a secret so we can use it as 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). \n\n#### Basic Example\n\nThe default behavior is to get the usage for the repository owner which is likely the organization.\n\n\u003e [!IMPORTANT]  \n\u003e You need to set the secret `TOKEN` in your repository settings.\n\n```yml\nname: Copilot Usage\non:\n  schedule:\n    - cron: '0 0 * * *'\n  workflow_dispatch:\n\njobs:\n  run:\n    name: Run Action\n    runs-on: ubuntu-latest\n    steps:\n      - uses: austenstone/copilot-usage@v5.2\n        with:\n          github-token: ${{ secrets.TOKEN }}\n          time-zone: 'EST'\n```\n\n#### Example get team usage\n\n```yml\n      - uses: austenstone/copilot-usage@v5.2\n        with:\n          github-token: ${{ secrets.TOKEN }}\n          organization: 'org-slug'\n          team: 'team-slug'\n```\n\n#### Example get CSV\n\n```yml\n      - uses: austenstone/copilot-usage@v5.2\n        with:\n          github-token: ${{ secrets.TOKEN }}\n          csv: true\n```\n\n#### Example multiple teams\n```yml\n    strategy:\n      matrix:\n        team:\n          - 'team-slug1'\n          - 'team-slug2'\n    steps:\n      - uses: actions/checkout@v4\n      - uses: austenstone/copilot-usage@v5.2\n        with:\n          github-token: ${{ secrets.TOKEN }}\n          organization: 'org-slug'\n          team: ${{ matrix.team }}\n```\n\n#### Example specific timezone\n\nYou probably want to specify the timezone to get the usage in your local time. The default is UTC.\nEX: `EST`, `PST`, `CST`, [etc](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).\n\n```yml\n      - uses: austenstone/copilot-usage@v5.2\n        with:\n          github-token: ${{ secrets.TOKEN }}\n          organization: 'org-slug'\n          time-zone: 'EST'\n```\n\n#### Example sending email PDF report\n\n\u003e [!IMPORTANT]  \n\u003e You must set secrets for `EMAIL` and `PASSWORD` to send the email. You must use an [App Password](https://support.google.com/accounts/answer/185833?visit_id=638496193361004722-1436339969\u0026p=InvalidSecondFactor\u0026rd=1#app-passwords) for Gmail.\n\n```yml\nname: Email Copilot Report\non:\n  workflow_dispatch:\n  schedule:\n    - cron: '0 0 * * *'\n\njobs:\n  run:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: austenstone/copilot-usage@v5.2\n        with:\n          github-token: ${{ secrets.TOKEN }}\n      - uses: austenstone/job-summary@v2.0\n        id: pdf\n        with:\n          name: copilot-usage\n      - uses: dawidd6/action-send-mail@v4\n        with:\n          server_address: smtp.gmail.com\n          server_port: 465\n          username: ${{ secrets.EMAIL }}\n          password: ${{ secrets.PASSWORD }}\n          from: ${{ secrets.EMAIL }}\n          to: ${{ secrets.EMAIL }} # Recipient email\n          subject: \"Copilot Usage Report (${{ steps.usage.outputs.since }} - ${{ steps.usage.outputs.until }})\"\n          html_body: |\n            \u003c!DOCTYPE html\u003e\n            \u003chtml\u003e\n            \n            \u003cbody\u003e\n              \u003ch1\u003eCopilot Usage Report\u003c/h1\u003e\n              \u003cp\u003eAttached is the Copilot Usage Report for ${{ steps.usage.outputs.since }} - ${{ steps.usage.outputs.until }}!\u003c/p\u003e\n              \u003cp\u003e\n                \u003ca href=\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}#:~:text=Copilot%20Usage%20summary\"\u003eView the full report on\n                  GitHub.com\u003c/a\u003e\n              \u003c/p\u003e\n\n              ${{ steps.pdf.outputs.job-summary-html }}\n              \n            \u003c/body\u003e\n            \n            \u003c/html\u003e\n          attachments: ${{ steps.pdf.outputs.pdf-file }}\n```\n\n\u003e [!TIP]\n\u003e Try using other messaging systems such as [slack](https://github.com/marketplace/actions/slack-send), [teams](https://github.com/marketplace/actions/microsoft-teams-notification), [discord](https://github.com/marketplace/actions/discord-message-notify), etc.\n\n![image](https://github.com/austenstone/copilot-usage/assets/22425467/94c9c913-3924-495a-9d7f-6b79185de219)\n\n## ➡️ Inputs\n\nIf no `organization` or `team` input are provided, we default to the repository owner which is likely the organization.\n\nVarious inputs are defined in [`action.yml`](action.yml):\n\n| Name | Description | Default |\n| --- | --- | --- |\n| github-token | The GitHub token used to create an authenticated client | |\n| organization | The organization slug | ${{ github.repository_owner }} |\n| job-summary | Whether to generate a report | true |\n| csv | Whether to generate a CSV as a workflow artifact | false |\n| csv-options | The options for the CSV report | |\n| xml | Whether to generate an XML as a workflow artifact | false |\n| xml-options | The options for the XML report | |\n| team | The team slug | |\n| days | The number of days to show usage metrics for | |\n| since | Show usage metrics since this date. This is a timestamp, in `YYYY-MM-DD` format. Maximum value is 28 days ago | |\n| until | Show usage metrics until this date. This is a timestamp, in `YYYY-MM-DD` format. Maximum value is 28 days ago | |\n| time-zone | The time zone to use for the report | UTC |\n\n## ⬅️ Outputs\n| Name | Description |\n| --- | - |\n| result | The copilot usage as a JSON string |\n| since | The date since which the usage metrics are shown |\n| until | The date until which the usage metrics are shown |\n\n### Endpoints\n\nThe endpoints used by this action...\n\n* GET /orgs/{org}/team/{team}/copilot/usage\n* GET /orgs/{org}/copilot/usage\n* GET /orgs/{org}/copilot/billing\n* GET /orgs/{org}/copilot/billing/seats\n\n## Example Job Summary\n\n[View latest reports](https://github.com/austenstone/copilot-usage/actions/workflows/usage.yml)\n\n","funding_links":["https://github.com/sponsors/austenstone"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustenstone%2Fcopilot-usage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustenstone%2Fcopilot-usage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustenstone%2Fcopilot-usage/lists"}