This GitHub Action generates commit statistics for a specified GitHub repository or organization.
You can use this action in your workflow by triggering it manually with the required inputs.
name: Get Commit Stats
on:
workflow_dispatch:
inputs:
repository:
description: 'Repository name (format: owner/repo)'
required: true
type: string
organization:
description: 'Organization name'
required: false
type: string
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Commit Statistics
uses: ./.github/actions/commit-stats
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
repository: ${{ inputs.repository }}
organization: ${{ inputs.organization }}
Input | Description | Required |
---|---|---|
repository |
The repository to analyze in the format owner/repo |
Yes |
organization |
The organization name to analyze | No |
The action requires a Personal Access Token (PAT) with appropriate permissions to access the repository statistics. The token should be stored as a repository secret named PAT
.
The action uses the following npm packages:
- @octokit/rest
- @actions/core
- @actions/github