Skip to content

Commit 3637c7d

Browse files
committed
[feat] Add input to disable commenting test run url on PR
1 parent 2a05678 commit 3637c7d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

action.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ inputs:
2525
cloud-run-locally:
2626
description: 'If true, run tests locally instead and upload results to Grafana Cloud k6'
2727
required: false
28+
comment-cloud-test-run-url-on-pr:
29+
description: 'If true, comment the cloud test run URL on the pull request'
30+
default: "true"
31+
required: false
2832

2933
runs:
3034
using: node20

src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export async function run(): Promise<void> {
2121
const failFast = core.getInput('fail-fast', { required: false }) === 'true'
2222
const flags = core.getInput('flags', { required: false })
2323
const cloudRunLocally = core.getInput('cloud-run-locally', { required: false }) === 'true'
24+
const shouldCommentCloudTestRunUrlOnPR = core.getInput('comment-cloud-test-run-url-on-pr', { required: false }) === 'true'
2425

2526
const isCloud = await isCloudIntegrationEnabled()
2627

@@ -30,7 +31,7 @@ export async function run(): Promise<void> {
3031
set: (target: TestRunUrlsMap, key: string, value: string) => {
3132
target[key] = value;
3233
if (Object.keys(target).length === TOTAL_TEST_RUNS) {
33-
if (isCloud) {
34+
if (isCloud && shouldCommentCloudTestRunUrlOnPR) {
3435
// Generate PR comment with test run URLs
3536
generatePRComment(target);
3637
}

0 commit comments

Comments
 (0)