Summary
The skip-comment input is inverted in main.go. With the documented default (false), the action does not post a PR comment. Setting skip-comment: true is what actually calls postGithubComment.
This matches action.yml:
Skip commenting on PR. If set to true, the action will not comment on the PR, but will still set outputs.
Default is false, so comments should be posted.
Reproduction
- Use
launchdarkly/find-code-references-in-pull-request@v2 (observed SHA 3d0cb58224bc446bd9fe84faab3a1c4d8134cf76).
- Do not set
skip-comment (defaults to false), or set skip-comment: false.
- Open a PR that adds a flag key present in the LaunchDarkly project.
Expected: A "LaunchDarkly flag references" comment on the PR.
Actual: Job succeeds, flags are found, then the log says:
Processing comment...
Skipping comment creation as skip-comment is set to true
The GITHUB_TOKEN in our run had PullRequests: write and Issues: write. No CreateComment / EditComment call was made.
Cause
if !config.SkipComment {
gha.Log("Skipping comment creation as skip-comment is set to true")
} else {
err = postGithubComment(ctx, flagsRef, config, existingComment, *event.PullRequest.Number, comment)
}
When SkipComment is false (default), !config.SkipComment is true, so the skip path runs.
Config parsing itself looks correct (strconv.ParseBool on INPUT_SKIP-COMMENT in config/config.go).
Suggested fix
if config.SkipComment {
gha.Log("Skipping comment creation as skip-comment is set to true")
} else {
err = postGithubComment(ctx, flagsRef, config, existingComment, *event.PullRequest.Number, comment)
}
Please publish a @v2 tag that includes the fix. The current inversion means every consumer on the default config silently loses PR comments.
Summary
The
skip-commentinput is inverted inmain.go. With the documented default (false), the action does not post a PR comment. Settingskip-comment: trueis what actually callspostGithubComment.This matches
action.yml:Default is
false, so comments should be posted.Reproduction
launchdarkly/find-code-references-in-pull-request@v2(observed SHA3d0cb58224bc446bd9fe84faab3a1c4d8134cf76).skip-comment(defaults tofalse), or setskip-comment: false.Expected: A "LaunchDarkly flag references" comment on the PR.
Actual: Job succeeds, flags are found, then the log says:
The GITHUB_TOKEN in our run had
PullRequests: writeandIssues: write. NoCreateComment/EditCommentcall was made.Cause
When
SkipCommentisfalse(default),!config.SkipCommentis true, so the skip path runs.Config parsing itself looks correct (
strconv.ParseBoolonINPUT_SKIP-COMMENTinconfig/config.go).Suggested fix
Please publish a
@v2tag that includes the fix. The current inversion means every consumer on the default config silently loses PR comments.