Skip to content

Commit e72fdc4

Browse files
authored
Modify GitHub Actions workflow for documentation updates
1 parent c767b17 commit e72fdc4

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

.github/workflows/main.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
20+
ref: ${{ github.head_ref }} # Checkout the PR branch directly
2021

2122
- name: Install Cursor CLI
2223
run: |
@@ -56,38 +57,38 @@ jobs:
5657
- name: Update docs for changed subdirectories
5758
if: steps.detect-changes.outputs.changed_subdirs != ''
5859
env:
59-
MODEL: gpt-5
60+
MODEL: gpt-4o
6061
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
6162
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62-
BRANCH_PREFIX: docs
6363
CHANGED_SUBDIRS: ${{ steps.detect-changes.outputs.changed_subdirs }}
6464
run: |
6565
cursor-agent -p "You are operating in a GitHub Actions runner to update documentation summary files.
6666
67-
The GitHub CLI is available as \`gh\` and authenticated via \`GH_TOKEN\`. Git is available. You have write access to repository contents and can comment on pull requests, but you must not create or edit PRs.
67+
The GitHub CLI is available as \`gh\` and authenticated via \`GH_TOKEN\`. Git is available. You have write access to repository contents and can comment on pull requests.
6868
6969
# Context:
7070
- Repo: ${{ github.repository }}
7171
- Owner: ${{ github.repository_owner }}
7272
- PR Number: ${{ github.event.pull_request.number }}
7373
- Base Ref: ${{ github.base_ref }}
7474
- Head Ref: ${{ github.head_ref }}
75-
- Docs Branch Prefix: ${{ env.BRANCH_PREFIX }}
7675
- Changed Subdirectories: $CHANGED_SUBDIRS
76+
- Current Branch: ${{ github.head_ref }} (you are already on the PR branch)
7777
7878
# Goal:
79-
Update the llms.txt and llms-full.txt files in the changed subdirectories based on the content changes in those subdirectories.
79+
Update the llms.txt and llms-full.txt files in the changed subdirectories and commit directly to the current PR branch.
8080
8181
# Requirements:
82-
1) For each subdirectory in CHANGED_SUBDIRS, analyze what changed in that subdirectory since the last commit.
82+
1) For each subdirectory in CHANGED_SUBDIRS, analyze what changed in that subdirectory since the base branch.
8383
2) Update ONLY the llms.txt and llms-full.txt files in those specific subdirectories (e.g., docs/base-account/llms.txt, docs/base-account/llms-full.txt).
8484
3) DO NOT update the root-level llms.txt or llms-full.txt files.
8585
4) The llms.txt should be a concise summary/index of the documentation in that subdirectory.
8686
5) The llms-full.txt should be a comprehensive guide with code examples and detailed explanations.
8787
6) Maintain the existing format and style of these files.
88-
7) Create or update a persistent docs branch for this PR using the Docs Branch Prefix.
89-
8) Push changes to origin.
90-
9) Post or update a single PR comment explaining what was updated with an inline compare link.
88+
7) ONLY commit and push changes if there are actual updates needed to the llms files.
89+
8) If no updates are needed, do NOT create any commits or comments.
90+
9) Commit directly to the current PR branch (${{ github.head_ref }}) - do NOT create separate branches.
91+
10) If you make changes, add a simple comment to the PR explaining what was updated.
9192
9293
# File Structure Context:
9394
Each subdirectory (base-account, base-app, base-chain, cookbook, get-started, learn, mini-apps, onchainkit) contains:
@@ -96,15 +97,21 @@ jobs:
9697
- An llms-full.txt file (comprehensive guide with code examples)
9798
9899
# Instructions:
99-
1) Use \`gh pr diff\` to see what changed in the PR for the specific subdirectories.
100+
1) Use \`gh pr diff ${{ github.event.pull_request.number }}\` to see what changed in the PR for the specific subdirectories.
100101
2) Read the current llms.txt and llms-full.txt files in each changed subdirectory.
101102
3) Scan the .mdx files in each changed subdirectory to understand the content.
102-
4) Update the llms.txt and llms-full.txt files to reflect any new content, changes, or reorganization.
103-
5) Ensure the updates are accurate and maintain the existing style.
104-
6) Only make changes if documentation updates are actually needed.
105-
106-
# Deliverables when updates occur:
107-
- Updated llms.txt and llms-full.txt files in the relevant subdirectories
108-
- Pushed commits to the persistent docs branch
109-
- A PR comment with inline compare link for easy PR creation
103+
4) Update the llms.txt and llms-full.txt files ONLY if the changes warrant updates to the summaries.
104+
5) If you make updates, commit them with a clear message like 'docs: update llms summaries for [subdirectory]'.
105+
6) Push the commit to the current branch.
106+
7) Add a brief comment to the PR explaining what was updated.
107+
8) If no updates are needed, do nothing - no commits, no comments, no branches.
108+
109+
# Important: Avoid Getting Stuck
110+
- If there are no changes to make, simply exit without doing anything.
111+
- Do not create empty commits or branches.
112+
- Do not post comments if no changes were made.
113+
114+
# Workflow:
115+
1. Check what changed → 2. Determine if llms files need updates → 3. If yes: update, commit, push, comment → 4. If no: do nothing and exit
116+
110117
" --force --model "$MODEL" --output-format=text

0 commit comments

Comments
 (0)