Skip to content

Commit

Permalink
feat(ci): Create automatic report of Github actions usage (#1206)
Browse files Browse the repository at this point in the history
Create automatic report of Github actions usage via https://github.com/fergusmacd/github-actions-usage/tree/v0.9.2

Screenshot
Results look like this:

+--------------------------------+--------------------------------+--------+-------+---------+
| Repo Name                      | Workflow                       | Ubuntu | MacOS | Windows |
+--------------------------------+--------------------------------+--------+-------+---------+
| loculus                        | actions-usage.yml              |   1    |   0   |    0    |
|                                | backend.yml                    |  6702  |   0   |    0    |
|                                | clean-cache-post-merge.yml     |  161   |   0   |    0    |
|                                | config-preprocessor-build.yml  |  961   |   0   |    0    |
|                                | docs-build.yml                 |   34   |   0   |    0    |
|                                | docs-deploy.yml                |  141   |   0   |    0    |
|                                | dummyPreprocessing.yml         |  1047  |   0   |    0    |
|                                | e2e-k3d.yml                    | 10302  |   0   |    0    |
|                                | e2e.yml                        |   0    |   0   |    0    |
|                                | format-website-on-dispatch.yml |   5    |   0   |    0    |
|                                | full.yml                       |   0    |   0   |    0    |
|                                | keycloakify-build.yml          |  414   |   0   |    0    |
|                                | node_dev.yml                   |  1123  | 16820 |   3560  |
|                                | preprocessing-nextclade.yaml   |  1573  |   0   |    0    |
|                                | update-argocd-metadata.yml     |  410   |   0   |    0    |
|                                | website.yml                    |  6475  |   0   |    0    |
|                                | pages-build-deployment         |   0    |   0   |    0    |
| --------                       | --------                       | -----  | ----- |  -----  |
| Usage Minutes 2024-02-29 19:36 |                                | 29349  | 16820 |   3560  |
| --------                       | --------                       | -----  | ----- |  -----  |
| Stats From GitHub              |                                |        |       |         |
| Monthly Allowance: 3000.0      |                                |        |       |         |
| Usage Minutes: 49697           |                                | 297    | 16820 |   60    |
| Remaining Minutes: -46697.0    |                                |        |       |         |
| Alarm Triggered at: 100        |                                |        |       |         |
| Paid Minutes: 46697            |                                |        |       |         |
| Days Left in Cycle: 8          |                                |        |       |         |
+--------------------------------+--------------------------------+--------+-------+---------+
  • Loading branch information
corneliusroemer committed Feb 29, 2024
1 parent aae283d commit 9d06cc5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/actions-usage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Github Actions Usage Stats

on:
workflow_dispatch:
schedule:
- cron: "0 3 * * *" # Runs at 03:00 AM (UTC) every day

jobs:
gha-usage-minutes-report:
runs-on: ubuntu-latest
steps:
- name: GitHub Actions Usage Audit
uses: fergusmacd/github-action-usage@v0.9.2
with:
organisation: loculus-project
gitHubAPIKey: ${{ secrets.ORG_READ }} # Token requires read access for actions
raisealarmremainingminutes: -100000 # Negative so that it doesn't raise alarm when running out of free minutes
skipReposWithoutUsage: true

0 comments on commit 9d06cc5

Please sign in to comment.