Skip to content

ActionsDesk/ghec-enterprise-reporting

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Enterprise Cloud Billing and Usage Reporting

This action extracts billing and usage numbers from a GitHub enterprise and creates a report as an issue in the repository where it is running.

Inputs

  • enterprise_slug: The slug of the enterprise you wish to query

  • enterprise_token: The token that has access to the enterprise you wish to query

    This should be created as a GitHub Actions secret in the repository that is using this action. This token should have the following scopes:

    • admin:enterprise
    • admin:org
  • github_token: The token that will be used to create the issue (defaults to the automatic token provided by GitHub)

  • issue_title: The title of the report issue (default: GHEC Usage Report)

    This title will be used as the issue title, as well as the top heading of the issue body with the date of the run appended to it.

Usage

A great way to using this action is with a scheduler. Here's an example workflow file that will run our action on the 28th day of the month, every month:

on:
  schedule:
    - cron: '0 0 28 * *'

jobs:
  report:
    name: Report on GitHub Enterprise Cloud Usage
    runs-on: ubuntu-latest

    steps:
      - name: Generate Report
        id: report
        uses: ActionsDesk/[email protected] # Replace with the latest version
        with:
          enterprise_slug: awesome-enterprise
          enterprise_token: ${{ secrets.ENTERPRISE_TOKEN }}
          issue_title: My Enterprise Report

Example Output

The following Markdown will be generated in the issue body:

This usage report is for the **ENTERPRISE_SLUG** GHEC account.

## AssetPacks

Total Purchased: 6

## Enterprise Organizations

| Name     | Login     | Billing Email |
| -------- | --------- | ------------- |
| ORG_NAME | ORG_LOGIN | BILLING_EMAIL |

## Bandwidth

| Usage | Quota | Usage Percentage |
| ----- | ----- | ---------------- |
| 0     | 0     | 0                |

## Storage

| Usage | Quota | Usage Percentage |
| ----- | ----- | ---------------- |
| 0     | 0     | 0                |

## Licenses

| Total Licenses | All Licensable Users Count | Total Available Licenses |
| -------------- | -------------------------- | ------------------------ |
| 0              | 0                          | 0                        |

## Actions Usage

| Minutes Used | Paid Minutes Used | Included Minutes |
| ------------ | ----------------- | ---------------- |
| 0            | 0                 | 0                |

## Packages Usage

| Total GB Bandwidth Used | Total Paid GB Bandwidth Used | Included GB Bandwidth |
| ----------------------- | ---------------------------- | --------------------- |
| 0                       | 0                            | 0                     |

## Shared Storage Usage

| Days Left In Cycle | Estimated Paid Storage For Month | Estimated Storage For Month |
| ------------------ | -------------------------------- | --------------------------- |
| 0                  | 0                                | 0                           |

Contributing

All contributions are welcome, from issues to pull requests. Please take a look at our CONTRIBUTION.md file for details!