Skip to content

Commit d0bf39d

Browse files
committed
actually use the new flag
1 parent 3894bcb commit d0bf39d

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

.github/workflows/examples.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ jobs:
452452
title: Works (sticky)
453453
notify_issue: true
454454
notify_check: true
455+
sticky_comment: true
455456

456457
test_output_sticky_notifs_bad:
457458
name: 'Output (sticky notif, fails)'
@@ -468,3 +469,4 @@ jobs:
468469
title: Fails (sticky)
469470
notify_issue: true
470471
notify_check: true
472+
sticky_comment: true

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fixtures/file1_basic.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ A
22
B
33
C
44
D
5-
ABC

src/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as github from '@actions/github';
33
import fs from 'fs';
44
import {parseInputs} from './inputs';
55
import {processDiff} from './processing';
6-
import {createRun, upsertComment} from './notifications';
6+
import {createComment, createRun, upsertComment} from './notifications';
77

88
async function run(): Promise<void> {
99
try {
@@ -25,7 +25,11 @@ async function run(): Promise<void> {
2525
core.debug(`Notification: Issue`);
2626
const issueId = github.context.issue.number;
2727
if (issueId || issueId === 0) {
28-
await upsertComment(octokit, github.context, result, inputs.notifications.label);
28+
if (inputs.notifications.sticky) {
29+
await upsertComment(octokit, github.context, result, inputs.notifications.label);
30+
} else {
31+
await createComment(octokit, github.context, result, inputs.notifications.label);
32+
}
2933
} else {
3034
core.debug(`Notification: no issue id`);
3135
}

src/notifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ${result.output}
5050
${commentLocator(label)}`;
5151
};
5252

53-
const createComment = async (
53+
export const createComment = async (
5454
octokit: InstanceType<typeof GitHub>,
5555
context: Context,
5656
result: Result,

0 commit comments

Comments
 (0)