From 433abffbf5ceed327a99af91a43557afff3377b2 Mon Sep 17 00:00:00 2001 From: n-ogawa Date: Sat, 26 Nov 2022 14:21:01 +0900 Subject: [PATCH] Add calculate usage workflow --- .github/workflows/calc-usage.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/calc-usage.yml diff --git a/.github/workflows/calc-usage.yml b/.github/workflows/calc-usage.yml new file mode 100644 index 00000000..961503d5 --- /dev/null +++ b/.github/workflows/calc-usage.yml @@ -0,0 +1,22 @@ +name: Calculate usage + +on: +# schedule: +# - cron: '5 0 1 * *' + workflow_dispatch: + +jobs: + calc-usage: + runs-on: ubuntu-latest + steps: + - name: Set Start Date + run: echo "START_DATE=$(date -d "$(date +'%Y%m01') 1 month ago" +'%Y-%m-%d')" >> $GITHUB_ENV + - name: Set End Date + run: echo "END_DATE=$(date -d "$(date +'%Y%m01') 1 days ago" +'%Y-%m-%d')" >> $GITHUB_ENV + - uses: muno92/gha-usage@v0.1.0 + with: + repo: ${{ github.repository }} + start-date: ${{ env.START_DATE }} + end-date: ${{ env.END_DATE }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}