Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pull-request-analytics-action",
"version": "4.4.0",
"version": "4.4.2",
"description": "Generates detailed PR analytics reports within GitHub, focusing on review efficiency and team performance.",
"main": "build/index.js",
"scripts": {
Expand Down
35 changes: 21 additions & 14 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import {
validate,
} from "./common/utils";
import { getRateLimit } from "./requests/getRateLimit";
import {
sendActionError,
sendActionRun,
} from "./analytics";
import { sendActionError, sendActionRun } from "./analytics";

async function main() {
try {
Expand All @@ -34,11 +31,17 @@ async function main() {
);
return;
}
const rateLimitAtBeginning = await getRateLimit();
console.log(
"RATE LIMIT REMAINING BEFORE REQUESTS: ",
rateLimitAtBeginning.data.rate.remaining
);
try {
const rateLimitAtBeginning = await getRateLimit();
console.log(
"RATE LIMIT REMAINING BEFORE REQUESTS: ",
rateLimitAtBeginning.data.rate.remaining
);
} catch (error) {
console.log(
"Rate limit could not be retrieved at the beginning of the action"
);
}

const ownersRepos = getOwnersRepositories();
const organizationsRepos = await getOrganizationsRepositories();
Expand Down Expand Up @@ -93,11 +96,15 @@ async function main() {
console.log("Calculation complete. Generating markdown.");
await createOutput(preparedData);

const rateLimitAtEnd = await getRateLimit();
console.log(
"RATE LIMIT REMAINING AFTER REQUESTS: ",
rateLimitAtEnd.data.rate.remaining
);
try {
const rateLimitAtEnd = await getRateLimit();
console.log(
"RATE LIMIT REMAINING AFTER REQUESTS: ",
rateLimitAtEnd.data.rate.remaining
);
} catch (error) {
console.log("Rate limit could not be retrieved at the end of the action");
}
} catch (error) {
sendActionError(error as Error);
throw error;
Expand Down
Loading