-
Notifications
You must be signed in to change notification settings - Fork 5
Add a GH workflow to automate the generation of weekly status updates #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📋 Weekly Status (auto-generated DEV)Last week's achievements
Plans for next week
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds automation for generating weekly status updates from GitHub issues and pull requests. The solution uses a Python script that queries GitHub's APIs (GraphQL for Projects v2 and REST for labels/issues) to collect items completed last week and items planned for next week, formatting them into a Markdown document.
Key changes:
- New Python script to generate status reports from GitHub issues/PRs with flexible data source options (Projects v2, labels, or issue state)
- Production workflow that runs weekly on Mondays and saves the output as an artifact
- Development workflow for testing changes via PR comments and manual runs
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| scripts/weekly_status_markdown.py | Core script implementing GitHub API queries, time-window filtering, and Markdown generation |
| .github/workflows/weekly-update.yml | Production workflow scheduled for Monday mornings with Projects v2 configuration |
| .github/workflows/weekly-update-dev.yml | Development workflow for testing that posts results as PR comments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - "scripts/weekly_confluence_markdown.py" | ||
| - ".github/workflows/weekly-update-dev.yml" | ||
| # run on any PR that targets your default branch and originates from same repo | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "scripts/weekly_confluence_markdown.py" |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path filter references 'weekly_confluence_markdown.py' but the actual script is named 'weekly_status_markdown.py'. This will prevent the workflow from triggering when the script is modified.
| - "scripts/weekly_confluence_markdown.py" | |
| - ".github/workflows/weekly-update-dev.yml" | |
| # run on any PR that targets your default branch and originates from same repo | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "scripts/weekly_confluence_markdown.py" | |
| - "scripts/weekly_status_markdown.py" | |
| - ".github/workflows/weekly-update-dev.yml" | |
| # run on any PR that targets your default branch and originates from same repo | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "scripts/weekly_status_markdown.py" |
| - "scripts/weekly_confluence_markdown.py" | ||
| - ".github/workflows/weekly-update-dev.yml" | ||
| # run on any PR that targets your default branch and originates from same repo | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "scripts/weekly_confluence_markdown.py" |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path filter references 'weekly_confluence_markdown.py' but the actual script is named 'weekly_status_markdown.py'. This will prevent the workflow from triggering when the script is modified.
| - "scripts/weekly_confluence_markdown.py" | |
| - ".github/workflows/weekly-update-dev.yml" | |
| # run on any PR that targets your default branch and originates from same repo | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "scripts/weekly_confluence_markdown.py" | |
| - "scripts/weekly_status_markdown.py" | |
| - ".github/workflows/weekly-update-dev.yml" | |
| # run on any PR that targets your default branch and originates from same repo | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "scripts/weekly_status_markdown.py" |
|
|
||
| OUTPUT_PATH: artifacts/weekly_status.md | ||
| run: | | ||
| python scripts/weekly_confluence_markdown.py | tee /tmp/out.md |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script path is incorrect. It should be 'scripts/weekly_status_markdown.py' instead of 'scripts/weekly_confluence_markdown.py'.
|
|
||
| out_path = os.environ.get("OUTPUT_PATH") | ||
| if out_path: | ||
| os.makedirs(os.path.dirname(out_path), exist_ok=True) |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail if out_path has no directory component (e.g., just a filename). When os.path.dirname(out_path) returns an empty string, os.makedirs('') raises an error. Add a check: if dir_path := os.path.dirname(out_path): os.makedirs(dir_path, exist_ok=True)
| os.makedirs(os.path.dirname(out_path), exist_ok=True) | |
| if dir_path := os.path.dirname(out_path): | |
| os.makedirs(dir_path, exist_ok=True) |
| # Plans: open items that were updated in the last week (showing active work) | ||
| plans = [it for it in inprog_items if it.get("state") == "open" and updated_recent(it, days=7)] |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filter checks it.get('state') == 'open' but the 'state' field is only populated in the state-based approach (line 374), not when using Projects v2 or label-based queries. This will incorrectly exclude all items when using Projects v2. Remove the state check or ensure the state field is always populated.
| # Plans: open items that were updated in the last week (showing active work) | |
| plans = [it for it in inprog_items if it.get("state") == "open" and updated_recent(it, days=7)] | |
| # Plans: items that were updated in the last week (showing active work) | |
| plans = [it for it in inprog_items if updated_recent(it, days=7)] |
This PR adds a script and a workflow to automate the generation of an update document.
The document contains two lists of GH issues: