diff --git a/.github/workflows/cache.yaml b/.github/workflows/cache.yaml new file mode 100644 index 0000000..bea98e9 --- /dev/null +++ b/.github/workflows/cache.yaml @@ -0,0 +1,22 @@ +name: Cache +on: + schedule: + - cron: '0 * * * *' +jobs: + cache: + runs-on: ubuntu-latest + steps: + - run: | + SIZE=$(PAGER=cat gh api -H "Accept: application/vnd.github.v3+json" /repos/$REPO/actions/cache/usage -q ".active_caches_size_in_bytes") + echo ::set-output name=SIZE::$(bc <<< "scale=4; $SIZE / 1000000000") + id: size + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + - uses: RubbaBoy/BYOB@v1.2.1 + with: + NAME: Cache size + LABEL: 'Cache size' + STATUS: ${{ steps.size.outputs.SIZE }} + COLOR: 00EEFF + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}