Skip to content
View gangwgr's full-sized avatar

Block or report gangwgr

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
gangwgr/README.md

Hi, I'm Rahul Gangwar πŸ‘‹

I work on building, testing, and automating components of the Kubernetes and OpenShift control plane β€” with strong focus on API machinery, operators, e2e testing, and cluster reliability.

Cloud Native Engineer OpenShift & Kubernetes


πŸ“ˆ GitHub Stats

GitHub Stats


🐍 Contribution Snake

Snake animation


πŸ› οΈ About This Repository

This repository contains a custom GitHub stats card generator built in Go. The stats card is automatically generated daily via GitHub Actions and displays various GitHub contribution metrics.

Features

  • Automatic Updates: Stats card regenerates daily via GitHub Actions
  • Retry Logic: Exponential backoff for resilient API calls
  • Rate Limit Handling: Gracefully handles GitHub API rate limits
  • Dark Mode Support: Automatically adapts to user's color scheme preference
  • Configurable: Environment variables for customization
  • Accessibility: SVG includes proper ARIA labels and semantic markup

πŸš€ Quick Start

Prerequisites

  • Go 1.23 or higher
  • GitHub Personal Access Token with read:user and repo scopes

Installation

  1. Clone this repository:
git clone https://github.com/gangwgr/gangwgr.git
cd gangwgr
  1. Install dependencies:
go mod download
  1. Set up your GitHub token:
export GITHUB_TOKEN="your_github_token_here"

Usage

Generate Stats Card

# Using Go run
make run

# Or build and run
make build
./bin/generate-stats-card

Configuration Options

Configure the generator using environment variables:

Variable Description Default
GITHUB_TOKEN GitHub Personal Access Token (required) -
GITHUB_USERNAME GitHub username to generate stats for gangwgr
OUTPUT_DIR Directory to save the generated SVG output
OUTPUT_FILE Filename for the SVG stats-card.svg
VERBOSE Enable verbose logging false

Example with custom configuration:

export GITHUB_TOKEN="ghp_xxxxx"
export GITHUB_USERNAME="yourusername"
export OUTPUT_DIR="custom-output"
export VERBOSE=true
make run

πŸ“¦ Available Make Commands

make help           # Show available commands
make build          # Build the binary
make run            # Generate stats card
make clean          # Remove generated files
make fmt            # Format Go code
make lint           # Run linters
make test           # Run tests
make check          # Run formatting and linting
make generate       # Clean and regenerate stats card
make install-tools  # Install development tools

πŸ”„ GitHub Actions Automation

The stats card is automatically regenerated daily at 00:00 UTC using GitHub Actions. The workflow:

  1. Fetches the latest contribution data from GitHub API
  2. Generates a new SVG stats card
  3. Commits and pushes the updated card to the output branch

To set up automation for your own fork:

  1. Fork this repository
  2. Go to Settings β†’ Secrets and variables β†’ Actions
  3. Add a new secret named STATS_TOKEN with your GitHub Personal Access Token
  4. The workflow will run automatically daily

πŸ§ͺ Testing

Run the test suite:

# Run all tests
make test

# Run tests with verbose output
go test -v ./...

# Run tests with coverage
go test -v -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out

πŸ“Š Stats Card Metrics

The generated card displays:

  • Total Stars: Stars across all your repositories
  • Total Commits: Commits made in 2025
  • Total PRs: Pull requests opened in 2025
  • Total Issues: Issues opened in 2025
  • Contributed To: Number of repositories you've contributed to
  • Total Contributions: Total contributions in 2025

🎨 Customization

Styling the SVG

Edit the SVG styles in generate-stats-card.go in the generateStatsCardSVG function. The SVG uses CSS for styling and includes both light and dark mode themes.

Adding New Metrics

To add new metrics:

  1. Update the GraphQL query in fetchStats() function
  2. Add fields to the StatsCard struct
  3. Update the GitHubResponse struct to match the API response
  4. Modify generateStatsCardSVG() to display the new metrics

🀝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests
  • Improve documentation

πŸ“ License

This project is open source and available under the MIT License.


πŸ”— Links


Built with ❀️ using Go and GitHub Actions

Pinned Loading

  1. origin origin Public

    Forked from openshift/origin

    Conformance test suite for OpenShift

    Go

  2. release release Public

    Forked from openshift/release

    Release tooling for OpenShift

    Shell

  3. openshift/origin openshift/origin Public

    Conformance test suite for OpenShift

    Go 8.6k 4.8k

  4. openshift/microshift openshift/microshift Public

    A small form factor OpenShift/Kubernetes optimized for edge computing

    Go 804 223

  5. openshift/release openshift/release Public

    Release tooling for OpenShift

    Shell 311 2k

  6. openshift/verification-tests openshift/verification-tests Public

    Blackbox test suite for OpenShift.

    Gherkin 60 174