Skip to content

Commit 38e222f

Browse files
committed
fix: Update date property references in run function for consistency
1 parent 2bc64f5 commit 38e222f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/run.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const run = async (): Promise<void> => {
120120
return warn("No Copilot usage data found");
121121
}
122122
debug(JSON.stringify(data, null, 2));
123-
info(`Fetched Copilot usage data for ${data.length} days (${data[0].day} to ${data[data.length - 1].day})`);
123+
info(`Fetched Copilot usage data for ${data.length} days (${data[0].date} to ${data[data.length - 1].date})`);
124124

125125
if (input.jobSummary) {
126126
setJobSummaryTimeZone(input.timeZone);
@@ -129,11 +129,11 @@ const run = async (): Promise<void> => {
129129

130130
if (input.organization && !input.team) { // refuse to fetch organization seat info if looking for team usage
131131
info(`Fetching Copilot details for organization ${input.organization}`);
132-
const orgSeatInfo = await octokit.rest.copilot.getCopilotOrganizationDetails({
132+
const orgCopilotDetails = await octokit.rest.copilot.getCopilotOrganizationDetails({
133133
org: input.organization
134-
});
135-
if (orgSeatInfo?.data) {
136-
await createJobSummarySeatInfo(orgSeatInfo.data).write();
134+
}).then(response => response.data);
135+
if (orgCopilotDetails) {
136+
await createJobSummarySeatInfo(orgCopilotDetails).write();
137137
}
138138

139139
info(`Fetching Copilot seat assignments for organization ${input.organization}`);
@@ -174,8 +174,8 @@ const run = async (): Promise<void> => {
174174
}
175175

176176
setOutput("result", JSON.stringify(data));
177-
setOutput("since", data[0].day);
178-
setOutput("until", data[data.length - 1].day);
177+
setOutput("since", data[0].date);
178+
setOutput("until", data[data.length - 1].date);
179179
setOutput("days", data.length.toString());
180180
};
181181

0 commit comments

Comments
 (0)