Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
72 changes: 72 additions & 0 deletions .github/workflows/research-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Weekly Research Update

on:
schedule:
# Every Monday at 9 AM UTC
- cron: '0 9 * * 1'
workflow_dispatch: # Manual trigger

permissions:
contents: write
pull-requests: write

jobs:
update-research:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt

- name: Run research update script
id: research
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/update_research.py || echo "changes_made=false" >> "$GITHUB_OUTPUT"
echo "changes_made=true" >> "$GITHUB_OUTPUT"

Comment on lines +33 to +41
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix changes_made output logic so PRs only open when updates occur.

Right now:

run: |
  python scripts/update_research.py || echo "changes_made=false" >> "$GITHUB_OUTPUT"
  echo "changes_made=true" >> "$GITHUB_OUTPUT"

will always end by writing changes_made=true, so the PR step runs even when there are no updates or when the script errors.

A minimal fix is to gate the output on the script’s exit code:

-      - name: Run research update script
-        id: research
-        env:
-          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        run: |
-          python scripts/update_research.py || echo "changes_made=false" >> "$GITHUB_OUTPUT"
-          echo "changes_made=true" >> "$GITHUB_OUTPUT"
+      - name: Run research update script
+        id: research
+        env:
+          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          if python scripts/update_research.py; then
+            echo "changes_made=true" >> "$GITHUB_OUTPUT"
+          else
+            echo "changes_made=false" >> "$GITHUB_OUTPUT"
+          fi

Note: because the script currently exits 1 both for “no changes” and for errors, this wrapper treats both cases as changes_made=false and the job as success. If you want to distinguish real failures, consider giving the script a separate non‑1 error code and updating the wrapper accordingly.

Also applies to: 42-43

🤖 Prompt for AI Agents
.github/workflows/research-update.yml lines 33-41 (and similarly 42-43): the
step currently always writes changes_made=true after running the script, so PRs
open even when no changes or on error; change the step to run the script, check
its exit status, and write changes_made=true only when it succeeds and changes
were made, otherwise write changes_made=false, and ensure the step itself exits
successfully (so the workflow continues) by returning 0 after setting the
output. Implement this by running the python script, using its exit code to
conditionally append the appropriate changes_made value to $GITHUB_OUTPUT, and
ensure the wrapper always exits 0 so failures in the script are treated as
changes_made=false rather than failing the step.

- name: Create Pull Request
if: steps.research.outputs.changes_made == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'docs: update research report with latest findings'
branch: automated/research-update
delete-branch: true
title: 'Weekly Research Update: Agent-Ready Codebase Attributes'
body: |
## Automated Research Update

This PR contains weekly updates to the AgentReady research report based on:
- Recent publications on AI-assisted development
- New best practices from authoritative sources
- Updated citations and references

**Review Checklist**:
- [ ] All citations include valid URLs
- [ ] Updates are relevant to attribute definitions
- [ ] Document structure is preserved
- [ ] Version number incremented appropriately
- [ ] Date updated to current

**Generated by**: Weekly Research Update workflow
**Triggered**: ${{ github.event_name }}
**Run ID**: ${{ github.run_id }}
labels: |
documentation
automated
research
Loading
Loading