Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
27266ea
Add organization repository report workflow and report generation script
mimiflynn May 21, 2026
3420a7d
Potential fix for pull request finding
mimiflynn May 21, 2026
83b6c9a
Potential fix for pull request finding
mimiflynn May 21, 2026
0f336ab
Refactor GitHub API request handling and improve report generation logic
mimiflynn May 21, 2026
edc3117
Merge branch 'workflow-github-org-report' of github.com:morganstanley…
mimiflynn May 21, 2026
aeda25a
Refactor CSV and Markdown writing functions to use a consistent UNKNO…
mimiflynn May 21, 2026
3ae6e9a
Enhance workflow to support pull request validation and artifact uplo…
mimiflynn May 21, 2026
ff11c88
Refactor GitHub API request handling for improved readability and err…
mimiflynn May 21, 2026
edbfcba
dependabot config for actions
mimiflynn May 22, 2026
d5916cf
Enhance GitHub workflow to validate report script changes and run tes…
mimiflynn May 22, 2026
a0bf516
Refactor report script change detection to use GitHub API for improve…
mimiflynn May 22, 2026
526d1cb
Refactor import statement for report module to improve code organization
mimiflynn May 22, 2026
38f550c
Refactor GitHubClient to improve data handling and simplify audit sup…
mimiflynn May 22, 2026
d92cf9a
Fix import statement for report module to enhance code organization
mimiflynn May 22, 2026
7165a7b
Fix import statement for report module to comply with linting rules
mimiflynn May 22, 2026
889ba60
Remove workflow_dispatch and pull_request triggers from org-repo-repo…
mimiflynn May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
commit-message:
prefix: chore
- package-ecosystem: pip
directory: /reporting
schedule:
interval: weekly
open-pull-requests-limit: 5
commit-message:
prefix: chore
88 changes: 88 additions & 0 deletions .github/workflows/org-repo-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Organization Repository Report

on:
schedule:
- cron: '0 6 * * 1'

permissions:
contents: write
pull-requests: read

concurrency:
group: org-repo-report-github-org-stats
cancel-in-progress: true

Comment thread
mimiflynn marked this conversation as resolved.
jobs:
generate-org-repo-report:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Detect report script changes
if: ${{ github.event_name == 'pull_request' }}
id: report-script-changes
uses: actions/github-script@v7
with:
script: |
const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
per_page: 100,
});

const reportScriptChanged = files.some(
(file) => file.filename === 'reporting/generate_org_repo_report.py'
);

core.info(`report_script changed: ${reportScriptChanged}`);
core.setOutput('report_script', reportScriptChanged ? 'true' : 'false');

- name: Run report script tests
if: ${{ github.event_name == 'pull_request' && steps.report-script-changes.outputs.report_script == 'true' }}
run: |
python -m pip install --upgrade pip
python -m pip install -r reporting/requirements-dev.txt
ruff check reporting
mypy reporting/generate_org_repo_report.py
pytest -q reporting/tests

- name: Generate report
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
ORG_NAME: morganstanley
OUTPUT_CSV: reporting/org-repo-report.csv
OUTPUT_MD: reporting/org-repo-report.md
run: python reporting/generate_org_repo_report.py
Comment thread
mimiflynn marked this conversation as resolved.

- name: Upload report artifacts for PR validation
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: org-repo-report
path: |
reporting/org-repo-report.csv
reporting/org-repo-report.md

- name: Commit and push report
if: ${{ github.event_name != 'pull_request' }}
run: |
Comment thread
mimiflynn marked this conversation as resolved.
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -B github-org-stats
git add reporting/org-repo-report.csv reporting/org-repo-report.md
if git diff --cached --quiet; then
echo "No report changes to commit."
exit 0
fi
git commit -m "chore(reporting): update organization repository report"
git push origin HEAD:github-org-stats
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
*.py[cod]
Loading
Loading