Skip to content

Commit

Permalink
Update github-repo-stats.yml workflows
Browse files Browse the repository at this point in the history
Get list of repositories to process using the GitHub CLI instead
of a hard coded list

Also updates the databranch, and adds a dev container and maintainers
file

Signed-off-by: James Taylor <[email protected]>
  • Loading branch information
jt-nti committed Dec 6, 2024
1 parent 0734bdc commit 90a00b0
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 83 deletions.
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
86 changes: 19 additions & 67 deletions .github/workflows/github-repo-stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,78 +7,27 @@ on:
workflow_dispatch:

jobs:
# Find all the cicsdev repositories to generate reports for
define-matrix:
runs-on: ubuntu-latest

outputs:
repos: ${{ steps.repos.outputs.repos }}

steps:
- name: Define Repositories
id: repos
env:
GH_TOKEN: ${{ github.token }}
run: |
gh search repos --owner=cicsdev --visibility=public --archived=false --limit=99 --json=name --jq=[.[].name] >> "$GITHUB_OUTPUT"
run-ghrs-with-matrix:
name: github-repo-stats
runs-on: ubuntu-latest
strategy:
matrix:
# The repositories to generate reports for.
statsRepo:
- "cicsdev/cicstg-jca-liberty-sample"
- "cicsdev/cicstg-client-blocker"
- "cicsdev/cicstg-cloud-monitor"
- "cicsdev/cics-java-liberty-jaxrs"
- "cicsdev/cics-java-liberty-jaxws"
- "cicsdev/cics-java-osgi-mq-jms"
- "cicsdev/cics-java-liberty-appstate"
- "cicsdev/cics-java-recgen"
- "cicsdev/cics-java-liberty-globalhandler"
- "cicsdev/cics-java-j2cprog"
- "cicsdev/cics-async-api-fetch-child-example"
- "cicsdev/cics-async-api-credit-card-application-example"
- "cicsdev/cics-cpsm-wlm-trace"
- "cicsdev/cics-explorer-access-level-policing"
- "cicsdev/cics-java-liberty-restapp"
- "cicsdev/cics-async-api-channel-usage-example"
- "cicsdev/cics-bundle-scripts"
- "cicsdev/cics-java-batch"
- "cicsdev/cics-java-liberty-link"
- "cicsdev/cics-java-jcics-samples"
- "cicsdev/cics-event-consumer"
- "cicsdev/cics-ipic-heartbeat-disabler"
- "cicsdev/cics-async-fetch-variation-example"
- "cicsdev/cics-java-liberty-restapp-ext"
- "cicsdev/cics-java-liberty-tai-jwt"
- "cicsdev/cics-java-liberty-mq-jms"
- "cicsdev/cics-exci-64bit-connector"
- "cicsdev/cics-nodejs-exci-module"
- "cicsdev/cics-nodejs-exci-webapp-sample"
- "cicsdev/zospt-scripts"
- "cicsdev/cics-java-liberty-jdbc"
- "cicsdev/cics-java-liberty-sqlj"
- "cicsdev/cics-java-liberty-ejb"
- "cicsdev/cics-async-api-redbooks"
- "cicsdev/cics-java-liberty-employee-db"
- "cicsdev/cics-kerberos-sample"
- "cicsdev/cpsm-cicsplex-name-detector"
- "cicsdev/cics-java-osgi-ds"
- "cicsdev/cics-java-liberty-jaspic-jwt"
- "cicsdev/cics-java-liberty-loans-and-scoring"
- "cicsdev/cics-nodejs-invoke"
- "cicsdev/cics-java-liberty-app-deployment"
- "cicsdev/cics-policy-samples"
- "cicsdev/cics-java-jcicsx-samples"
- "cicsdev/cics-java-liberty-springboot-jcics"
- "cicsdev/cics-java-liberty-springboot-security"
- "cicsdev/blog-cics-java-mq-jms-osgi"
- "cicsdev/blog-cics-java-osgi-classloading"
- "cicsdev/blog-cics-java-batch"
- "cicsdev/blog-cics-java-jta-jdbc"
- "cicsdev/blog-cics-java-liberty-ejb"
- "cicsdev/blog-cics-java-osgi-best-practices"
- "cicsdev/cics-java-liberty-springboot-transactions"
- "cicsdev/cics-blog-sample-files"
- "cicsdev/cics-java-liberty-springboot-link"
- "cicsdev/cics-java-liberty-springboot-jdbc-multi"
- "cicsdev/cics-java-liberty-springboot-jdbc"
- "cicsdev/cics-java-liberty-springboot-jpa"
- "cicsdev/cics-java-liberty-springboot-asynchronous"
- "cicsdev/cics-genapp"
- "cicsdev/cics-java-liberty-springboot-jms"
- "cicsdev/cics-eventprocessing-java"
- "cicsdev/base64"
- "cicsdev/cics-banking-sample-application-cbsa"
- "cicsdev/cics-security-sdv-samples"
statsRepo: ${{ fromJSON(needs.define-matrix.outputs.repos) }}
# Do not cancel&fail all remaining jobs upon first job failure.
fail-fast: false
# Help avoid commit conflicts. Note(JP): this should not be
Expand All @@ -87,6 +36,9 @@ jobs:
steps:
- name: run-ghrs
uses: jgehrcke/github-repo-stats@306db38ad131cab2aa5f2cd3062bf6f8aa78c1aa
# Exclude non-sample repos
if: ${{ !contains(fromJSON('[".github", "repo-stats", "cicsdev.github.io"]'), matrix.statsRepo) }}
with:
repository: ${{ matrix.statsRepo }}
databranch: reports
ghtoken: ${{ secrets.ghrs_github_api_token }}
5 changes: 5 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Maintainers

- James Taylor [@jt-nti](https://github.com/jt-nti)

*Last reviewed:* December 2024
17 changes: 1 addition & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,5 @@ The `cicsdev-summary.sh` script can be used to create summary files for *clones*

1. copy `cicsdev-summary.sh` to a suitable directory on your path, e.g. `~/bin`
2. clone the `repo-stats` repository
3. check out the `github-repo-stats` branch
3. check out the `reports` branch
4. run `cicsdev-summary.sh` from the root of the `repo-stats` repository

## TODO

Get the list of repos automatically instead of hard coding it in the workflow

For now, the following command will fetch a list of public repos for pasting in

```
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/orgs/cicsdev/repos?per_page=100&type=public" | \
yq '[.[].full_name | select(. != "cicsdev/cicsdev.github.io")]'
```

0 comments on commit 90a00b0

Please sign in to comment.