From 1730f0ff50345a93a8ec0768b643cd3804c1a497 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Thu, 8 Feb 2024 18:56:01 +0900 Subject: [PATCH] ci: count packages (#19793) * ci: count packages * ci: set the permissions --- .github/workflows/count-pkgs.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/count-pkgs.yaml diff --git a/.github/workflows/count-pkgs.yaml b/.github/workflows/count-pkgs.yaml new file mode 100644 index 00000000000..04ce56a7ae3 --- /dev/null +++ b/.github/workflows/count-pkgs.yaml @@ -0,0 +1,31 @@ +--- +name: Count packages +on: + workflow_call: {} + schedule: + - cron: "0 0 * * *" # daily +jobs: + count-packages: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2 + - run: | + set -euo pipefail + n=$(find pkgs -name registry.yaml | wc -l) + echo "count=$n" >> "$GITHUB_OUTPUT" + id: aqua + - run: | + set -euo pipefail + n=$(asdf plugin list all | wc -l) + echo "count=$n" >> "$GITHUB_OUTPUT" + id: asdf + - run: gh issue comment "$NUMBER" --body "$BODY" + env: + NUMBER: "19792" + BODY: | + asdf: ${{steps.asdf.outputs.count}} + aqua: ${{steps.aqua.outputs.count}} + GITHUB_TOKEN: ${{github.token}}