Skip to content

πŸš€ GitHub Actions usage report #112

πŸš€ GitHub Actions usage report

πŸš€ GitHub Actions usage report #112

Workflow file for this run

name: πŸš€ GitHub Actions usage report
on:
workflow_dispatch:
schedule:
# Runs at 00:40 UTC on the first of every week (Monday)
#
# β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ minute
# β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ hour
# β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ day (month)
# β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€ month
# β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€ day (week)
- cron: '40 0 * * 1'
jobs:
org:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: run actions export
run: |
npm install @stoe/action-reporting-cli --global
npx @stoe/action-reporting-cli --owner ${{ env.ORG }} --uses --csv actions-output.csv --md actions-output.md --json actions-output.json
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
ORG: ${{ github.repository_owner }}
- name: output csv
run: |
cat actions-output.csv
- name: output json
run: |
jq . < actions-output.json > actions-output-pretty.json
mv -f actions-output-pretty.json actions-output.json
cat actions-output.json
- name: output md
run: |
cat actions-output.md
# redirect to job summary
- name: upload job summary
run: |
echo "# πŸš€πŸ“ Actions Report for org - markdown" >> $GITHUB_STEP_SUMMARY
cat actions-output.md >> $GITHUB_STEP_SUMMARY
- uses: actions/upload-artifact@v4
with:
name: output
path: actions-*
- name: push to git repo
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add actions-output.csv actions-output.json actions-output.md
git commit -m "updating organization actions reports"
git push