{"id":20696809,"url":"https://github.com/actionsdesk/enterprise-members-report-action","last_synced_at":"2025-04-22T20:43:39.680Z","repository":{"id":36961797,"uuid":"372469849","full_name":"ActionsDesk/enterprise-members-report-action","owner":"ActionsDesk","description":"📊  📑  Action to generate a report as markdown, html or json with the members, outside collaborators and pending invites.","archived":false,"fork":false,"pushed_at":"2024-09-30T18:10:22.000Z","size":5047,"stargazers_count":2,"open_issues_count":7,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-13T15:54:47.135Z","etag":null,"topics":["email","license","report"],"latest_commit_sha":null,"homepage":"https://github.com/services","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/ActionsDesk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":".github/code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/codeowners","security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-31T10:36:39.000Z","updated_at":"2024-09-30T18:10:23.000Z","dependencies_parsed_at":"2024-11-17T00:31:09.537Z","dependency_job_id":null,"html_url":"https://github.com/ActionsDesk/enterprise-members-report-action","commit_stats":{"total_commits":270,"total_committers":5,"mean_commits":54.0,"dds":"0.15555555555555556","last_synced_commit":"ee76718a0010813c1c6562eaa30e8a9edc138e7e"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":"ActionsDesk/ps-typescript-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActionsDesk%2Fenterprise-members-report-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActionsDesk%2Fenterprise-members-report-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActionsDesk%2Fenterprise-members-report-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActionsDesk%2Fenterprise-members-report-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ActionsDesk","download_url":"https://codeload.github.com/ActionsDesk/enterprise-members-report-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250321289,"owners_count":21411541,"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","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":["email","license","report"],"created_at":"2024-11-17T00:15:24.830Z","updated_at":"2025-04-22T20:43:39.662Z","avatar_url":"https://github.com/ActionsDesk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enterprise members report action\n\nAction to generate a report as markdown, html, csv or json with the members, outside collaborators and pending invites.\n\n## Description\n\nThis action generates a report for an enterprise with the following elements:\n- **Members**: a report of all users that are members of at least one org in the enterprise\n- **Outside collaborators**: a compilation of all outside collaborators in all the orgs\n- **Pending invites**: the list of all pending invites in all the orgs\n\n## How to\n\nThis actions has the following inputs:\n\n| Parameter           | Description                                                                                           | Default | Is Required |\n|---------------------|-------------------------------------------------------------------------------------------------------|---------|-------------|\n| token               | A personal access token with permissions on all the orgs of the enterprise                            | None    | ✅           |\n| enterprise          | The enterprise where we want to generate the report                                                   | None    | ✅           |\n| format              | Determines how the output parameter will be formatted. Supports: `json`, `markdown`, `csv` and `html` | None    | ✅           |\n| licenseUsage        | Enterprise License consumption CSV contents                                                           | None    | ❎           |\n| licenseUsageChanged | Enterprise License consumption CSV last changed date/time                                             | None    | ❎           |\n\nThis action has the following outputs:\n\n| Parameter | Description                                                                                                    |\n|-----------|----------------------------------------------------------------------------------------------------------------|\n| data      | The data extracted from the license API calls in the format specified. The type of the output is always string |\n\nHere you can see a workflow example using this action:\n\n```yml\nname: Report workflow\non: \n  schedule:\n    # every Tuesday at 07:00 UTC\n    - cron: '0 7 * * 3'\n\njobs:\n  sendReport:\n    runs-on: 'ubuntu-latest'\n    steps:\n    - name: Generate report\n      id: report\n      uses: ActionsDesk/enterprise-members-report-action@main\n      env:\n        # The default GITHUB_TOKEN from actions doesn't work here as it does not have enough permissions\n        GITHUB_TOKEN: ${{ secrets.YOUR_SECRET_TOKEN }}\n      with:\n        enterprise: avocado-corp\n        format: 'html'\n    # Then use ${{ steps.report.outputs.data }} to store/send the report somewhere\n    - run: echo '${{ steps.report.outputs.data }}'\n```\n\n## License Consumption Merging\n\nAt present it is not possible to use the GitHub API to obtain the type of license a user is consuming. \nYou can download the `consumed_licenses.csv` file from the enterprise portal, https://docs.github.com/en/billing/managing-your-license-for-github-enterprise/viewing-license-usage-for-github-enterprise, \nand the action can merge this information into the report. You will need to commit the `consumed_licenses.csv` to your repository, and update it when you need an up to date report.  \n\nYou will also need to ensure that the action has the content available for it, add the following step before you generate any reports:\n\n```yml\n      - name: Export license usage data\n        run: | \n          if [[ -f consumed_licenses.csv ]]; then\n            echo \"LICENSEUSAGE_CSV\u003c\u003cEOF\" \u003e\u003e $GITHUB_ENV\n            cat consumed_licenses.csv \u003e\u003e $GITHUB_ENV\n            echo \"EOF\" \u003e\u003e $GITHUB_ENV\n            echo \"LICENSEUSAGE_CSV_CHANGED=$(stat -c'%Y' consumed_licenses.csv | date -Iseconds)\" \u003e\u003e $GITHUB_ENV\n          fi\n```\n\nThen you can update the report generator with the extra settings:\n\n```yml\n      - name: Generate CSV report\n        id: report_csv\n        uses: ActionsDesk/enterprise-members-report-action@latest\n        env:\n          GITHUB_TOKEN: ${{ secrets.YOUR_SECRET_TOKEN }}\n        with:\n          enterprise: avocado-corp\n          format: 'csv'\n          licenseUsage: ${{ env.LICENSEUSAGE_CSV }}\n          licenseUsageChanged: ${{ env.LICENSEUSAGE_CSV_CHANGED }}\n```\n\nA new column will be added to the generated report with type of licensed consumed by the user:\n\n| Login         | Emails             | Orgs                         | Membership           | Created At           | License (2021-09-10T16:54:27+01:00) |\n| ------------- | ------------------ | ---------------------------- | -------------------- | -------------------- | ----------------------------------- |\n| gwenavocado   | gwen@avocado.com   | avocado-haas                 | member               | 2020-09-29T14:07:38Z | Visual Studio subscription          |\n| fuerteavocado | fuerte@avocado.com | avocado-haas,avocado-zutano  | member               | 2020-10-14T21:25:58Z | Enterprise                          |\n| toast         | fresh@toast.com    | avocado-zutano               | outside collaborator | 2020-10-14T21:25:58Z | Enterprise                          |\n\nThe variable `licenseUsageChanged` is optional and if supplied with be included in the `License` column header as a reference for when the `consumed_licenses.csv` file was last modified.\n\n## Token permissions\n\nThe required scopes for this action to run are:\n- `admin:enterprise`\n- `admin:org`\n- `read:user`\n- `user:email`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factionsdesk%2Fenterprise-members-report-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factionsdesk%2Fenterprise-members-report-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factionsdesk%2Fenterprise-members-report-action/lists"}