-
Notifications
You must be signed in to change notification settings - Fork 9
69 lines (63 loc) · 2.05 KB
/
copilot-issue.yml
File metadata and controls
69 lines (63 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Create Issue for Copilot Coding Agent
on:
workflow_dispatch:
inputs:
title:
description: 'Issue title'
required: false
type: string
push:
branches: [main]
paths:
- '.github/workflows/copilot-issue.yml'
- '.github/scripts/ci/create-issue-assigned-to-copilot.ts'
jobs:
create-issue:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create issue and assign to Copilot
env:
GH_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
run: |
TITLE="${{ inputs.title || 'Investigation needed from Copilot Coding Agent' }}"
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/issues \
--input - <<< "$(jq -n \
--arg title "$TITLE" \
--arg repo "${{ github.repository }}" \
'{
title: $title,
agent_assignment: {
target_repo: $repo,
base_branch: "main",
custom_instructions: "",
custom_agent: "",
model: ""
}
}')"
create-issue-graphql:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Install dependencies
run: npm install @octokit/rest tsx
working-directory: .github/scripts/ci
- name: Create issue via GraphQL
env:
GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
GITHUB_REPO_OWNER: ${{ github.repository_owner }}
GITHUB_REPO_NAME: ${{ github.event.repository.name }}
run: npx tsx create-issue-assigned-to-copilot.ts "${{ inputs.title || 'Investigation needed from Copilot Coding Agent' }}"
working-directory: .github/scripts/ci