From 52a16803106ee9bdaf54976dc649f4f8ac89fe50 Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Thu, 29 Feb 2024 20:25:27 +0100 Subject: [PATCH 1/4] Try out usage audit --- .github/workflows/actions-usage.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/actions-usage.yml diff --git a/.github/workflows/actions-usage.yml b/.github/workflows/actions-usage.yml new file mode 100644 index 000000000..a4573308c --- /dev/null +++ b/.github/workflows/actions-usage.yml @@ -0,0 +1,21 @@ +name: Github Actions Usage Audit + +on: + workflow_dispatch: + schedule: + - cron: "0 3 * * *" # Runs at 03:00 AM (UTC) every day + push: + +jobs: + gha-usage-minutes-report: + runs-on: ubuntu-latest + steps: + - name: GitHub Actions Usage Audit + uses: fergusmacd/github-action-usage@v0.9.2 # use a commit SHA + # pass user input as arguments + with: + organisation: loculus-project + gitHubAPIKey: ${{ secrets.GITHUB_TOKEN }} + loglevel: error # not required, change to debug if misbehaving + raisealarmremainingminutes: 100 # not required, defaults to 100 + skipReposWithoutUsage: true From 1dee2a33a21964f69a2ac4c3cb381218785cae78 Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Thu, 29 Feb 2024 20:35:34 +0100 Subject: [PATCH 2/4] Try with PAT --- .github/workflows/actions-usage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions-usage.yml b/.github/workflows/actions-usage.yml index a4573308c..23053f2ea 100644 --- a/.github/workflows/actions-usage.yml +++ b/.github/workflows/actions-usage.yml @@ -15,7 +15,7 @@ jobs: # pass user input as arguments with: organisation: loculus-project - gitHubAPIKey: ${{ secrets.GITHUB_TOKEN }} + gitHubAPIKey: ${{ secrets.ORG_READ }} loglevel: error # not required, change to debug if misbehaving raisealarmremainingminutes: 100 # not required, defaults to 100 skipReposWithoutUsage: true From 02ea0310c261923932a845d0d2000992cf914113 Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Thu, 29 Feb 2024 20:40:33 +0100 Subject: [PATCH 3/4] Try negative alarm --- .github/workflows/actions-usage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions-usage.yml b/.github/workflows/actions-usage.yml index 23053f2ea..59f7ac50f 100644 --- a/.github/workflows/actions-usage.yml +++ b/.github/workflows/actions-usage.yml @@ -17,5 +17,5 @@ jobs: organisation: loculus-project gitHubAPIKey: ${{ secrets.ORG_READ }} loglevel: error # not required, change to debug if misbehaving - raisealarmremainingminutes: 100 # not required, defaults to 100 + raisealarmremainingminutes: -100000 # not required, defaults to 100 skipReposWithoutUsage: true From 4456f8c03452bbf663666c64683c46984b9b628f Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Thu, 29 Feb 2024 20:48:34 +0100 Subject: [PATCH 4/4] Configure for main trunk --- .github/workflows/actions-usage.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/actions-usage.yml b/.github/workflows/actions-usage.yml index 59f7ac50f..bcc510e14 100644 --- a/.github/workflows/actions-usage.yml +++ b/.github/workflows/actions-usage.yml @@ -1,21 +1,18 @@ -name: Github Actions Usage Audit +name: Github Actions Usage Stats on: workflow_dispatch: schedule: - cron: "0 3 * * *" # Runs at 03:00 AM (UTC) every day - push: jobs: gha-usage-minutes-report: runs-on: ubuntu-latest steps: - name: GitHub Actions Usage Audit - uses: fergusmacd/github-action-usage@v0.9.2 # use a commit SHA - # pass user input as arguments + uses: fergusmacd/github-action-usage@v0.9.2 with: organisation: loculus-project - gitHubAPIKey: ${{ secrets.ORG_READ }} - loglevel: error # not required, change to debug if misbehaving - raisealarmremainingminutes: -100000 # not required, defaults to 100 + 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