2020 if : |
2121 github.event_name == 'repository_dispatch' ||
2222 (github.event_name == 'issues' && startsWith(github.event.issue.title, '[Auto] New Want:')) ||
23- (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@github-copilot[bot]') && contains(github.event.comment.body, 'process-want'))
23+ (github.event_name == 'issue_comment' && (
24+ contains(github.event.comment.body, '/process') ||
25+ contains(github.event.comment.body, '@github-copilot') ||
26+ (contains(github.event.comment.body, '@github-copilot[bot]') && contains(github.event.comment.body, 'process'))
27+ ))
2428 runs-on : ubuntu-latest
2529 steps :
30+ - name : Log workflow trigger
31+ run : |
32+ echo "=== Workflow Trigger Information ==="
33+ echo "Event name: ${{ github.event_name }}"
34+ echo "Triggered by: ${{ github.actor }}"
35+ echo "Repository: ${{ github.repository }}"
36+ if [ "${{ github.event_name }}" = "issue_comment" ]; then
37+ echo "Comment author: ${{ github.event.comment.user.login }}"
38+ echo "Issue number: ${{ github.event.issue.number }}"
39+ echo "Issue title: ${{ github.event.issue.title }}"
40+ echo "Comment body (first 200 chars): ${{ github.event.comment.body }}" | head -c 200
41+ fi
42+ echo "==================================="
2643 - name : Checkout repository
2744 uses : actions/checkout@v4
2845 with :
@@ -121,15 +138,27 @@ jobs:
121138 with :
122139 github-token : ${{ secrets.GITHUB_TOKEN }}
123140 script : |
124- const issue = github.event_name === 'issue_comment'
125- ? context.payload.issue
126- : context.payload.issue;
127-
128- const issueBody = issue.body;
141+ console.log('=== Processing existing issue/comment ===');
142+ console.log(`Event name: ${context.eventName}`);
143+ console.log(`Issue number: ${context.payload.issue.number}`);
144+
145+ const issue = context.payload.issue;
146+ const issueBody = issue.body || '';
147+
148+ console.log(`Issue title: ${issue.title}`);
149+ console.log(`Issue body length: ${issueBody.length}`);
150+
129151 const submissionIdMatch = issueBody.match(/\*\*Submission ID:\*\* (.+)/);
130152 const submissionId = submissionIdMatch ? submissionIdMatch[1] : `manual-${issue.number}-${Date.now()}`;
131-
132- if (github.event_name === 'issue_comment') {
153+
154+ console.log(`Submission ID: ${submissionId}`);
155+
156+ if (context.eventName === 'issue_comment') {
157+ console.log('Processing as issue comment event');
158+ const comment = context.payload.comment;
159+ console.log(`Comment author: ${comment.user.login}`);
160+ console.log(`Comment body: ${comment.body.substring(0, 200)}`);
161+
133162 const commentBody = [
134163 '## Manual Processing Triggered',
135164 '',
@@ -150,12 +179,14 @@ jobs:
150179 `Body: ${issueBody.substring(0, 500)}${issueBody.length > 500 ? '...' : ''}`
151180 ].join('\n');
152181
182+ console.log('Creating processing trigger comment...');
153183 await github.rest.issues.createComment({
154184 owner: context.repo.owner,
155185 repo: context.repo.repo,
156186 issue_number: issue.number,
157187 body: commentBody
158188 });
189+ console.log('Processing trigger comment created successfully');
159190 }
160191
161192 return {
@@ -168,9 +199,13 @@ jobs:
168199 with :
169200 github-token : ${{ secrets.GITHUB_TOKEN }}
170201 script : |
202+ console.log('=== Assigning to Copilot ===');
203+ console.log(`Event name: ${context.eventName}`);
204+
171205 // Get issue number from previous steps or current context
172206 let issueNumber;
173- if (github.event_name === 'repository_dispatch') {
207+ if (context.eventName === 'repository_dispatch') {
208+ console.log('Getting issue from repository_dispatch event');
174209 // For webhook events, we need to find the issue we just created
175210 // We'll use a simple approach and get the most recent issue
176211 const issues = await github.rest.issues.listForRepo({
@@ -183,16 +218,20 @@ jobs:
183218 per_page: 1
184219 });
185220 issueNumber = issues.data[0]?.number;
221+ console.log(`Found issue number: ${issueNumber}`);
186222 } else {
187223 // For issue events, use the issue from the event
188224 issueNumber = context.payload.issue.number;
225+ console.log(`Using issue from event: ${issueNumber}`);
189226 }
190227
191228 if (!issueNumber) {
192- console.log('Could not determine issue number');
229+ console.log('ERROR: Could not determine issue number');
193230 return;
194231 }
195232
233+ console.log(`Creating Copilot trigger comment on issue #${issueNumber}`);
234+
196235 // Add comment to trigger Copilot processing
197236 await github.rest.issues.createComment({
198237 owner: context.repo.owner,
@@ -203,13 +242,22 @@ jobs:
203242 Follow the 5-step process: spam detection, relevance check, technology classification, duplicate detection, and want PR creation if approved.`
204243 });
205244
206- console.log(`Issue ${issueNumber} has been assigned to Copilot for processing`);
245+ console.log(`Successfully assigned issue ${issueNumber} to Copilot for processing`);
207246
208247 - name : Log processing completion
209248 run : |
210- echo "Want submission processing workflow completed"
211- echo "Check GitHub Actions logs for issue details"
212- echo "Workflow triggered for submission processing"
249+ echo "==================================="
250+ echo "Want submission processing workflow completed successfully"
251+ echo "Event: ${{ github.event_name }}"
252+ echo "Triggered by: ${{ github.actor }}"
253+ echo "Repository: ${{ github.repository }}"
254+ echo "==================================="
255+ echo ""
256+ echo "Next steps:"
257+ echo "- Check the issue for Copilot's processing comments"
258+ echo "- Review any PR created by Copilot"
259+ echo "- Check GitHub Actions logs for detailed execution trace"
260+ echo "==================================="
213261
214262 convert-issue-to-discussion :
215263 if : github.event_name == 'pull_request' && github.event.pull_request.merged == true
0 commit comments