@@ -148,86 +148,23 @@ jobs:
148148 ISSUE_NUMBER=$(echo "$ISSUE_URL" | grep -oP '/issues/\K\d+')
149149 echo "issue_number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT
150150
151- - name : Wait for agent PR to be created
152- id : wait_for_pr
153- run : |
154- echo "Waiting for GitHub Copilot agent to create a PR..."
155- ISSUE_NUMBER="${{ steps.create_issue.outputs.issue_number }}"
156- MAX_ATTEMPTS=30
157- SLEEP_SECONDS=10
158- ATTEMPT=0
159- FOUND_PR=""
160-
161- # Auth using the token
162- gh auth login --with-token <<< "$GH_PLAYGROUND_TOKEN"
163-
164- while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
165- ATTEMPT=$((ATTEMPT + 1))
166- echo "Attempt $ATTEMPT of $MAX_ATTEMPTS..."
167-
168- # Try to find linked PRs by searching for PRs that reference this issue
169- LINKED_PRS=$(gh pr list \
170- --repo "${REPO_OWNER}/${REPO_NAME}" \
171- --search "linked:issue-${ISSUE_NUMBER}" \
172- --json number,url,title \
173- --jq '.[0].url' 2>/dev/null || echo "")
174-
175- if [ -n "$LINKED_PRS" ] && [ "$LINKED_PRS" != "null" ] && [ "$LINKED_PRS" != "" ]; then
176- echo "Found linked PR: $LINKED_PRS"
177- FOUND_PR="$LINKED_PRS"
178- break
179- fi
180-
181- # Also check for PRs created by the copilot bot recently
182- COPILOT_PRS=$(gh pr list \
183- --repo "${REPO_OWNER}/${REPO_NAME}" \
184- --author "copilot" \
185- --limit 5 \
186- --json number,url,title,createdAt \
187- --jq 'sort_by(.createdAt) | reverse | .[0].url' 2>/dev/null || echo "")
188-
189- if [ -n "$COPILOT_PRS" ] && [ "$COPILOT_PRS" != "null" ] && [ "$COPILOT_PRS" != "" ]; then
190- echo "Found recent copilot PR: $COPILOT_PRS"
191- FOUND_PR="$COPILOT_PRS"
192- break
193- fi
194-
195- if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then
196- echo "No PR found yet, waiting ${SLEEP_SECONDS} seconds..."
197- sleep $SLEEP_SECONDS
198- fi
199- done
200-
201- if [ -n "$FOUND_PR" ]; then
202- echo "pr_url=$FOUND_PR" >> $GITHUB_OUTPUT
203- else
204- echo "Warning: No PR found after $MAX_ATTEMPTS attempts"
205- echo "The agent may still be working on it."
206- echo "pr_url=" >> $GITHUB_OUTPUT
207- fi
208-
209- - name : Comment on PR with issue and agent PR links
151+ - name : Comment on PR with issue link
210152 uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
211153 with :
212154 github-token : ${{ secrets.GITHUB_TOKEN }}
213155 script : |
214156 const issueUrl = '${{ steps.create_issue.outputs.issue_url }}';
215- const prUrl = '${{ steps.wait_for_pr.outputs.pr_url }}';
216157 const scenarioName = '${{ steps.parse_scenario.outputs.scenario_name }}';
217158
218- let comment = `🤖 **AI Agent Task Created**
159+ const comment = `🤖 **AI Agent Task Created**
219160
220161 Scenario: **${scenarioName}**
221162
222163 An AI agent has been assigned to execute this scenario.
223164
224- 📝 **Issue:** ${issueUrl}`;
165+ 📝 **Issue:** ${issueUrl}
225166
226- if (prUrl) {
227- comment += `\n🔀 **Agent PR:** ${prUrl}`;
228- } else {
229- comment += `\n\n⏳ The agent is working on this task. The PR will be linked in the issue once created.`;
230- }
167+ Please navigate to the issue for more details and to track progress.`;
231168
232169 await github.rest.issues.createComment({
233170 issue_number: context.issue.number,
0 commit comments