From c68b740c290a98917b5872c3f6cc0227f644c569 Mon Sep 17 00:00:00 2001 From: Jimmy Royer Date: Fri, 27 Dec 2024 16:10:54 -0500 Subject: [PATCH] Updated the header documentation for the AI feedback collection script. --- src/exportComments.ts | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/exportComments.ts b/src/exportComments.ts index afb2f9d..59f5993 100644 --- a/src/exportComments.ts +++ b/src/exportComments.ts @@ -1,24 +1,37 @@ /** * This script fetches comments from specified GitHub pull requests and exports them to a CSV file. + * * It uses the GitHub API to retrieve the comments and filters them based on the provided author (if specified). - * The resulting CSV file contains the pull request number, author, comment, and a link to the comment. + * The resulting CSV file contains the date, AI feedback, pull request number, author, comment, and a link to + * the comment. * * Usage: * npx ts-node exportComments.ts --token --owner --repo --prs [--author ] * * Options: - * --token, -t GitHub personal access token (can also be set via the GITHUB_TOKEN environment variable) - * It is recommended to use the environment variable to avoid exposing sensitive information. - * --owner, -o Repository owner - * --repo, -r Repository name - * --prs, -p Comma-separated list of pull request numbers - * --author, -a Author of the comments to filter with (optional) + * --owner, -o Repository owner (required) + * --repo, -r Repository name (required) + * --author, -a Author of the comments to filter with (optional -- likely the AI bot author name) + * --since, -s Filter comments since the given date (YYYY-MM-DD) (required) + * --until, -u Filter comments until the given date (YYYY-MM-DD) (optional, defaults to now) + * --token, -t GitHub personal access token (can also be set via the GITHUB_TOKEN environment variable or `.env` file) + * It is recommended to use the environment variable to avoid exposing sensitive information. * * Example: * npx ts-node exportComments.ts --owner cds-snc --repo cds-ai-codereviewer --prs 6,7,8 --author github-actions[bot] + * + * npx ts-node src/exportComments.ts --owner cds-snc --repo notification-terraform --since 2024-12-01 --author 'github-actions[bot]' --until 2024-12-31 * * Environment Variable: * GITHUB_TOKEN GitHub personal access token (recommended to use this instead of --token argument) + * + * The GITHUB_TOKEN can be configured using a .env file at the root of the project: + * + * Example .env file: + * + * ```txt + * GITHUB_TOKEN=your_actual_token_here + * ``` */ import axios from "axios";