Skip to content

FMorschel/commit-count-badge

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Commit Count Badge

Generates a Shields.io badge for commit count in a specified repository.

Inputs

  • repository (required): The GitHub repository (user/project) to query commits from.
  • author (required): The author whose commits should be counted.
  • text (required): The label text for the badge.
  • outputPath (required): Path and file name for the generated badge (e.g., 'badges/dart-commits.svg').
  • token (required): GitHub token to authenticate API requests.
  • logo (optional): The logo to include in the badge. Default is 'github'.
  • labelColor (optional): The background color for the badge label. Default is '#0175C2'.
  • color (optional): The background color for the badge value. Default is 'lightgray'.

Example Usage

uses: FMorschel/commit-count-badge@v1
with:
  repository: 'flutter/flutter'
  author: 'FMorschel'
  text: 'Flutter SDK Commits'
  outputPath: 'badges/flutter-commits.svg'
  token: '${{ secrets.GITHUB_TOKEN }}'
  logo: 'flutter'
  labelColor: '#00A9E0'
  color: 'lightgray'

After this you probably want to commit and push badge, something like:

      - name: Commit and Push Badge
        run: |
          git config --global user.name "github-actions[bot]"
          git config --global user.email "github-actions[bot]@users.noreply.github.com"
          git add "badges/dart-commits.svg"
          if git diff --cached --quiet; then
            echo "No changes to commit"
            exit 0
          fi
          git commit -m "Update commit dart badge"
          git push

Description

This GitHub Action counts the number of commits made by a specified author in a repository and generates a Shields.io badge reflecting this count. The badge is saved to the specified output path within your repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Installation

Add the Action to Your Workflow

Include the action in your workflow YAML file as shown in the example usage.

Run the Workflow

The action can be triggered on a schedule or manually, depending on your workflow configuration.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.

Support

If you encounter any issues or have questions, feel free to open an issue in the repository.

About

Simple action to generate a custom commit count badge

Resources

License

Stars

Watchers

Forks

Packages

No packages published