nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: pulumi/actions
Pull request #248 (2021-05-24 16:02:18)

Fixup yarn tests


Patch:
diff --git a/src/config.ts b/src/config.ts
index 729806f..8c50964 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -64,7 +64,7 @@ export async function makeConfig(): Promise<Config> {
       target: parseArray(getInput('target')),
       targetDependents: parseBoolean(getInput('target-dependents')),
       editCommentOnPr: parseBoolean(getInput('edit-pr-comment')),
-      userAgent: "pulumi/action@v3"
+      userAgent: "pulumi/actions@v3"
     },
   });
 }


Test patch:
diff --git a/src/__tests__/config.test.ts b/src/__tests__/config.test.ts
index 194e73c..f494320 100644
--- a/src/__tests__/config.test.ts
+++ b/src/__tests__/config.test.ts
@@ -41,7 +41,7 @@ describe('config.ts', () => {
           "replace": undefined,
           "target": undefined,
           "targetDependents": undefined,
-          "userAgent" "pulumi/actions@v3",
+          "userAgent": "pulumi/actions@v3",
         },
         "refresh": undefined,
         "stackName": "dev",
@@ -94,7 +94,7 @@ describe('config.ts', () => {
           "replace": undefined,
           "target": undefined,
           "targetDependents": undefined,
-          "userAgent" "pulumi/actions@v3",
+          "userAgent": "pulumi/actions@v3",
         },
         "refresh": undefined,
         "stackName": "dev",
Repository: pulumi/actions
Pull request #280 (2021-06-11 18:57:27)

Improve Pull Request comments
resolves https://github.com/pulumi/actions/issues/200 Improve Pull Request comments



stack72: Thanks so much - this is great!!

Patch:
diff --git a/src/libs/pr.ts b/src/libs/pr.ts
index d7f8f8c..c2d50ce 100644
--- a/src/libs/pr.ts
+++ b/src/libs/pr.ts
@@ -5,11 +5,13 @@ import { invariant } from './utils';
 export async function handlePullRequestMessage(
   body: string,
   githubToken: string,
+  command: string,
+  stackName: string,
   editCommentOnPr?: boolean,
 ): Promise<void> {
   const { payload, repo } = context;
   invariant(payload.pull_request, 'Missing pull request event data.');
-  const text = `#### :tropical_drink: `
+  const text = `#### :tropical_drink: \`${command}\` on ${stackName}`
   const octokit = getOctokit(githubToken);
   const { data: comments} = await octokit.rest.issues.listComments({
     ...repo,
diff --git a/src/main.ts b/src/main.ts
index 751ef75..68665a6 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -86,10 +86,12 @@ const main = async () => {
     core.debug(`Commenting on pull request`);
     invariant(config.githubToken, 'github-token is missing.');
     handlePullRequestMessage(
-      `#### :tropical_drink: \`${config.command}\`
+      `#### :tropical_drink: \`${config.command}\` on ${config.stackName}
 \`\`\`
 ${output}
 \`\`\``,
+      config.command,
+      config.stackName,
       config.githubToken,
       config.options.editCommentOnPr
     );


Test patch:
diff --git a/src/libs/__tests__/pr.test.ts b/src/libs/__tests__/pr.test.ts
index 60506c8..ed6ee85 100644
--- a/src/libs/__tests__/pr.test.ts
+++ b/src/libs/__tests__/pr.test.ts
@@ -33,7 +33,7 @@ describe('pr.ts', () => {
 
     process.env.GITHUB_REPOSITORY = 'pulumi/actions';
 
-    await handlePullRequestMessage('test', 'test');
+    await handlePullRequestMessage('test', 'test', 'test', 'test');
     expect(listComments).toHaveBeenCalled();
     expect(createComment).toHaveBeenCalled();
   });
@@ -42,7 +42,7 @@ describe('pr.ts', () => {
     process.env.GITHUB_REPOSITORY = 'pulumi/actions';
     // @ts-ignore
     gh.context = { payload: {} };
-    await expect(handlePullRequestMessage('test', 'test')).rejects.toThrowError(
+    await expect(handlePullRequestMessage('test', 'test', 'test', 'test')).rejects.toThrowError(
       'Missing pull request event data',
     );
   });