Skip to content

Commit ad2f8a3

Browse files
authored
setting copilot labels and update dispatch to com-ops (community#190857)
* setting copilot labels and update dispatch to com-ops * Update GitHub token for label feedback dispatch
1 parent 9df6212 commit ad2f8a3

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

.github/DISCUSSION_TEMPLATE/code-security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
labels: [Code Security, source:ui]
1+
labels: ["Code Security", source:ui]
22
body:
33
- type: dropdown
44
attributes:

.github/DISCUSSION_TEMPLATE/copilot-conversations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
labels: [source:ui]
1+
labels: ["Copilot", "source:ui"]
22
body:
33
- type: markdown
44
attributes:

.github/workflows/label-feedback-dispatch.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Forward discussion label events
1919
uses: actions/github-script@v8
2020
with:
21-
github-token: ${{ secrets.COMMUNITY_OPS_DISPATCH_TOKEN }}
21+
github-token: ${{ secrets.WRITE_TO_COMM_OPS_TOKEN }}
2222
script: |
2323
const actor = context.actor;
2424
const action = context.payload.action;
@@ -45,18 +45,20 @@ jobs:
4545
repo,
4646
event_type: "staff-label-correction",
4747
client_payload: {
48-
source_repository: `${context.repo.owner}/${context.repo.repo}`,
49-
target_repository: `${context.repo.owner}/${context.repo.repo}`,
50-
discussion_number: discussion.number,
51-
discussion_title: discussion.title || "unknown",
52-
discussion_url: discussion.html_url || discussion.url || "",
53-
category: discussion.category?.name || "unknown",
54-
category_slug: discussion.category?.slug || "unknown",
55-
event_type: action,
56-
label: label.name,
57-
actor,
58-
createdAt: new Date().toISOString(),
48+
data: {
49+
source_repository: `${context.repo.owner}/${context.repo.repo}`,
50+
target_repository: `${process.env.COMMUNITY_OPS_REPOSITORY}`,
51+
discussion_number: discussion.number,
52+
discussion_title: discussion.title || "unknown",
53+
discussion_url: discussion.html_url || discussion.url || "",
54+
category: discussion.category?.name || "unknown",
55+
category_slug: discussion.category?.slug || "unknown",
56+
event_type: action,
57+
label: label.name,
58+
actor,
59+
createdAt: new Date().toISOString(),
60+
},
5961
},
6062
});
6163
62-
core.info(`Forwarded ${action} event for discussion #${discussion.number}`);
64+
core.info(`Forwarded ${action} event for discussion #${discussion.number}`);

0 commit comments

Comments
 (0)