From 237a538234d990f81687c68ba414cb08f28885f5 Mon Sep 17 00:00:00 2001 From: sergiov-ni Date: Wed, 30 Jul 2025 16:02:31 -0700 Subject: [PATCH] Add repo list and GitHub Pages --- .github/workflows/org-coding-hours.yml | 40 ++++++++++++++++++++++++++ README.md | 10 ++++--- docs/index.html | 37 ++++++++++++++++++++++++ repos.json | 7 +++++ 4 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/org-coding-hours.yml create mode 100644 docs/index.html create mode 100644 repos.json diff --git a/.github/workflows/org-coding-hours.yml b/.github/workflows/org-coding-hours.yml new file mode 100644 index 0000000..41d84bc --- /dev/null +++ b/.github/workflows/org-coding-hours.yml @@ -0,0 +1,40 @@ +name: Organization Coding Hours + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' + +jobs: + set-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + - id: set + run: echo "matrix=$(jq -c '.repos' repos.json)" >> $GITHUB_OUTPUT + + calculate: + needs: set-matrix + runs-on: ubuntu-latest + strategy: + matrix: + repo: ${{ fromJSON(needs.set-matrix.outputs.matrix) }} + steps: + - uses: actions/checkout@v4 + - name: Checkout target repository + uses: actions/checkout@v4 + with: + repository: ${{ matrix.repo }} + path: repo + - name: Run git-hours + uses: .github/actions/git-hours + with: + window_start: '' + working-directory: repo + - name: Upload report + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.repo }}-git-hours + path: repo/git-hours.json diff --git a/README.md b/README.md index b9adaf8..0774f2e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Coding Hours -This repository contains a reusable GitHub composite action for running the -[git-hours](https://github.com/kimmobrunfeldt/git-hours) tool. +This repository contains a reusable GitHub composite action for running the [git-hours](https://github.com/kimmobrunfeldt/git-hours) tool. ## Composite Action @@ -41,5 +40,8 @@ jobs: path: ${{ steps.hours.outputs.results }} ``` -Run the workflow manually and the resulting `git-hours.json` file will be -available as an artifact. +Run the workflow manually and the resulting `git-hours.json` file will be available as an artifact. + +## Organization Reports and GitHub Pages + +A separate workflow, `.github/workflows/org-coding-hours.yml`, reads a list of repositories from `repos.json` and generates coding hours reports for each one. The reports can be published or downloaded as artifacts. The repository also serves a GitHub Pages site under the `docs` folder that lists the repositories being tracked. diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..b5d0e1d --- /dev/null +++ b/docs/index.html @@ -0,0 +1,37 @@ + + + + + + Coding Hours Repositories + + + +

Repositories Tracked for Coding Hours

+ + + + diff --git a/repos.json b/repos.json new file mode 100644 index 0000000..f3247fa --- /dev/null +++ b/repos.json @@ -0,0 +1,7 @@ +{ + "repos": [ + "ni/labview-icon-editor", + "ni/actor-framework", + "ni/open-source" + ] +}