This composite GitHub Action calculates coding hours across one or more repositories, aggregates the per‑contributor statistics, generates JSON reports, builds a simple KPI website, and publishes both the metrics and the site to dedicated branches. The action encapsulates the logic from the Org Coding Hours workflow in the LabVIEW icon editor project.
| Name | Required | Default | Description |
|---|---|---|---|
repos |
Yes | – | A space‑separated list of repositories in owner/name form. Each repository is cloned and processed by the git‑hours CLI. |
window_start |
No | – | Optional start date (YYYY‑MM‑DD) passed to git‑hours -since to limit the reporting window. |
metrics_branch |
No | metrics |
The branch where the JSON reports are committed. |
pages_branch |
No | gh-pages |
The branch where the generated KPI website is committed (enables GitHub Pages). |
This action does not currently expose explicit outputs. Instead it writes per‑repository and aggregated JSON files into a reports/ directory, builds a static site in site/, commits the reports to the metrics_branch, and commits the site to the pages_branch. The commit history on those branches serves as the record of your organization’s coding hours.
To invoke this action from a workflow, ensure that your workflow has write permissions to contents and that your repository settings enable publishing from the specified pages_branch (typically gh-pages).
name: Org Coding Hours Report
on:
workflow_dispatch:
inputs:
repos:
description: 'Space‑separated list of repositories'
required: true
window_start:
description: 'Optional start date YYYY‑MM‑DD'
required: false
permissions:
contents: write
jobs:
org-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Org Coding Hours Action
uses: ./org-coding-hours-action
with:
repos: ${{ github.event.inputs.repos }}
window_start: ${{ github.event.inputs.window_start }}This workflow triggers manually through the GitHub UI. When run, it computes coding hours across the specified repositories, writes JSON reports to the metrics branch, and publishes the KPI website to the gh-pages branch.
For a simpler setup that processes only this repository, run scripts/repo_coding_hours.py after checking out the repo. The script runs git-hours in the repository root and writes reports/git-hours-<date>.json. It respects the optional WINDOW_START environment variable.
- The action installs a specific version of
git‑hours(v0.1.2) using Go 1.24 and executes a Python helper script. If you want to update the version, modify the clone command inaction.ymlaccordingly. - Both branches (
metrics_branchandpages_branch) are created automatically if they do not exist. Subsequent runs will update the existing branches without force‑pushing unless a non‑fast‑forward update is required.
| Contributor | Hours |
|---|---|
| sergio.velderrain@ni.com | 232.0 |
| sergio.velderrain@emerson.com | 124.0 |
| crossrulz@outlook.com | 77.0 |
| 156447188+svelderrainruiz@users.noreply.github.com | 73.0 |
| juan@hasbun-wood-engineering.de | 17.0 |
| greg.richardson@ni.com | 16.0 |
| github-actions[bot]@users.noreply.github.com | 11.0 |
| 60667522+crossrulz@users.noreply.github.com | 9.0 |
| 71788381+gregr-ni@users.noreply.github.com | 6.0 |
| 32969609+eyesonvis@users.noreply.github.com | 4.0 |
| jim.kring@jki.net | 2.0 |
| 131851960+yash-ni@users.noreply.github.com | 0.0 |
| 24767209+JayKayAce@users.noreply.github.com | 0.0 |
| 66672184+ThatsTheEnd@users.noreply.github.com | 0.0 |
| Elijah.Kerry@gmail.com | 0.0 |
| Elijah.Kerry@ni.com | 0.0 |
| Timothy.Robinson2@ngc.com | 0.0 |
| bot@github.com | 0.0 |