# bcanseco/github-contribution-graph-action architecture

> Architecture diagram of the GitHub repository bcanseco/github-contribution-graph-action, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bcanseco/github-contribution-graph-action
- Repository: https://github.com/bcanseco/github-contribution-graph-action

## Overview

This GitHub Action creates contribution-graph commits in a configured repository. The workflow reads and parses environment settings, prepares a local clone or fresh repository, selects eligible dates and randomized commit counts, creates empty dated commits, then pushes them to the configured branch. The source excerpts show the orchestration and random helper; README documents the supported configuration options. External GitHub Actions inputs and the Git remote are represented separately.

Main entry points: [`src/index.js`](https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js) (Environment configuration), [`src/random/index.js`](https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/random/index.js) (Random commit count)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Action workflow"]
  node_config["Environment configuration<br/>[index.js]"]
end

subgraph group_generation["Commit generation"]
  node_date_selection["Date selection<br/>[index.js]"]
  node_random_count["Random commit count<br/>[index.js]"]
  node_commit_creation["Empty commit creation<br/>[index.js]"]
end

subgraph group_remote["Repository access"]
  node_repo_setup["Local repository setup<br/>[index.js]"]
  node_push["Branch push<br/>[index.js]"]
end

node_runner(("GitHub Actions runner"))
node_git_remote[("Git remote repository")]

node_runner -->|"provides variables"| node_config
node_config -->|"configures repository"| node_repo_setup
node_config -->|"sets date range"| node_date_selection
node_date_selection -->|"requests count"| node_random_count
node_random_count -->|"returns count"| node_commit_creation
node_repo_setup -->|"clones repository"| node_git_remote
node_commit_creation -->|"writes commits"| node_repo_setup
node_push -->|"pushes branch"| node_git_remote
node_config -->|"sets push options"| node_push

click node_config "https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js"
click node_repo_setup "https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js"
click node_date_selection "https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js"
click node_random_count "https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/random/index.js"
click node_commit_creation "https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js"
click node_push "https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config toneBlue
class node_date_selection,node_random_count,node_commit_creation,node_git_remote toneAmber
class node_repo_setup,node_push toneMint
class node_runner toneIndigo
```

## Components

### Action workflow

- [Environment configuration](https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js): `src/index.js`

### Commit generation

- [Date selection](https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js): `src/index.js`
- [Random commit count](https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/random/index.js): `src/random/index.js`
- [Empty commit creation](https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js): `src/index.js`

### Repository access

- [Local repository setup](https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js): `src/index.js`
- [Branch push](https://github.com/bcanseco/github-contribution-graph-action/blob/master/src/index.js): `src/index.js`

### Other components

- **GitHub Actions runner**
- **Git remote repository**

## Connections

- GitHub Actions runner → Environment configuration: provides variables (evidence: `README.md`)
- Environment configuration → Local repository setup: configures repository (evidence: `src/index.js`)
- Environment configuration → Date selection: sets date range (evidence: `src/index.js`)
- Date selection → Random commit count: requests count (evidence: `src/index.js`)
- Random commit count → Empty commit creation: returns count (evidence: `src/index.js`)
- Local repository setup → Git remote repository: clones repository (evidence: `src/index.js`)
- Empty commit creation → Local repository setup: writes commits (evidence: `src/index.js`)
- Branch push → Git remote repository: pushes branch (evidence: `src/index.js`)
- Environment configuration → Branch push: sets push options (evidence: `src/index.js`)
