Skip to content

Pac-Man Contribution Graph Game

Transform your GitHub or GitLab contribution graph into an interactive Pac-Man game!

ref-reporef-online-toolref-official-docref-dependent-action

Usage

  1. In the repository, create a .github/workflows/ directory.
  2. Add pacman-contribution.yml file with the following content:
yaml
name: generate pacman game

on:
  # Run automatically every 24 hours
  schedule:
    - cron: "0 */24 * * *"

  # Allows manual triggering
  workflow_dispatch:

  # Runs on every push to the main branch
  push:
    branches:
      - main

jobs:
  generate:
    permissions:
      contents: write
    runs-on: ubuntu-latest
    timeout-minutes: 5

    steps:
      - name: generate pacman-contribution-graph.svg
        uses: abozanona/pacman-contribution-graph@main
        with:
          github_user_name: ${{ github.repository_owner }}

      # Push the generated SVG to the output branch
      - name: push pacman-contribution-graph.svg to the output branch
        uses: crazy-max/ghaction-github-pages@v3.1.0
        with:
          target_branch: output
          build_dir: dist
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1. In your repository, create or edit the README.md file to include:
markdown
## My Contribution Graph

<picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/[Owner]/[Repo]/output/pacman-contribution-graph-dark.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/[Owner]/[Repo]/output/pacman-contribution-graph.svg">
    <img alt="pacman contribution graph" src="https://raw.githubusercontent.com/[Owner]/[Repo]/output/pacman-contribution-graph.svg">
</picture>

Parameters

Click to show/close parameters

NameTypeRequiredDefaultDescriptionMore Description
ref-actions
github_user_namestringtrueGitHub username
github_tokenstringGitHub token

Examples

markdown
<!-- abozanona -->
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/abozanona/abozanona/output/pacman-contribution-graph-dark.svg">
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/abozanona/abozanona/output/pacman-contribution-graph.svg">
  <img alt="pacman contribution graph" src="https://raw.githubusercontent.com/abozanona/abozanona/output/pacman-contribution-graph.svg">
</picture>
pacman contribution graph

Readme Widget Hub (v4.1.4) MIT Licensed