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 @@ + + +
+ + +