Skip to content

Commit f54c91e

Browse files
committed
update to json
1 parent 158c98d commit f54c91e

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

.github/workflows/auto-llms-txt.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,30 @@ jobs:
5858
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5959
BRANCH_PREFIX: auto-llms
6060
run: |
61+
# Expand variables for the agent
62+
REPO="${{ github.repository }}"
63+
OWNER="${{ github.repository_owner }}"
64+
PR_NUMBER="${{ github.event.pull_request.number }}"
65+
BASE_REF="${{ github.base_ref }}"
66+
HEAD_REF="${{ github.head_ref }}"
67+
BRANCH_PREFIX="${{ env.BRANCH_PREFIX }}"
68+
6169
cursor-agent -p "You are operating in a GitHub Actions runner to automatically update llms.txt and llms-full.txt files.
6270
6371
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 directly.
6472
6573
IMPORTANT: Before starting your analysis, check if the user wants to stop by running:
66-
gh pr view ${{ github.event.pull_request.number }} --json comments --jq '.comments[] | select(.body | contains(\"stop\"))'
74+
gh pr view ${PR_NUMBER} --json comments --jq '.comments[] | select(.body | contains(\"stop\"))'
6775
6876
If this returns any results, immediately post a cancellation comment and exit. Otherwise, proceed with your analysis.
6977
7078
# Context:
71-
- Repo: ${{ github.repository }}
72-
- Owner: ${{ github.repository_owner }}
73-
- PR Number: ${{ github.event.pull_request.number }}
74-
- Base Ref: ${{ github.base_ref }}
75-
- Head Ref: ${{ github.head_ref }}
76-
- Branch Prefix: ${{ env.BRANCH_PREFIX }}
79+
- Repo: ${REPO}
80+
- Owner: ${OWNER}
81+
- PR Number: ${PR_NUMBER}
82+
- Base Ref: ${BASE_REF}
83+
- Head Ref: ${HEAD_REF}
84+
- Branch Prefix: ${BRANCH_PREFIX}
7785
7886
# Documentation Structure:
7987
This is a docs repository with the following main directories that each contain llms.txt and llms-full.txt files:
@@ -94,7 +102,7 @@ jobs:
94102
2) Determine which documentation directories are affected by the changes
95103
3) Assess if the changes are significant enough to update the llms.txt files (new content, major restructuring, new features, etc.)
96104
4) If changes are significant:
97-
- Create or update a persistent branch named \`${{ env.BRANCH_PREFIX }}/pr-${{ github.event.pull_request.number }}\`
105+
- Create or update a persistent branch named \`${BRANCH_PREFIX}/pr-${PR_NUMBER}\`
98106
- Update the relevant llms.txt and llms-full.txt files to reflect the new documentation structure and content
99107
- Push the changes to the branch
100108
- Comment on the original PR with a summary and a compare link to create the PR
@@ -122,4 +130,4 @@ jobs:
122130
- Keep all changes minimal and consistent with existing documentation style
123131
124132
CRITICAL: After completing ANY of the above actions (stop command, updates completed, or no updates needed), you MUST immediately exit by running 'exit 0'. Do not continue running or wait for additional input.
125-
" --force --model "$MODEL" --output-format=text
133+
" --force --model "$MODEL" --output-format=json

0 commit comments

Comments
 (0)