Skip to content

Commit a0710b1

Browse files
Copilotpelikhan
andauthored
fix: clarify test comment messages for workflow_call status-comment permissions
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent a1e2ecf commit a0710b1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

pkg/workflow/activation_permissions_scope_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,10 +605,11 @@ engine: copilot
605605

606606
activationJobSection := extractJobSection(string(lockContent), string(constants.ActivationJobName))
607607
assert.Contains(t, activationJobSection, "issues: write", "activation job should include issues: write when workflow_call + status-comment are configured")
608-
// pull-requests:write is only needed for PR reactions, not status-comments (which use the issues API)
609-
assert.NotContains(t, activationJobSection, "pull-requests: write", "activation job should not include pull-requests: write for status-comment-only (status-comments use issues API)")
610-
// discussions:write is included because status-comment includes discussions by default
611-
assert.Contains(t, activationJobSection, "discussions: write", "activation job should include discussions: write when workflow_call + status-comment with default discussion target are configured")
608+
// pull-requests:write is only needed for PR reactions (addBroadActivationInteractionPermissions only sets it for
609+
// hasReaction && reactionIncludesPullRequests); PR status-comments post via the issues API so issues:write suffices.
610+
assert.NotContains(t, activationJobSection, "pull-requests: write", "activation job should not include pull-requests: write for status-comment-only (PR status-comments use the issues API scope, not pull-requests)")
611+
// discussions:write is included because status-comment defaults include discussions (statusCommentIncludesDiscussions=true by default)
612+
assert.Contains(t, activationJobSection, "discussions: write", "activation job should include discussions: write when workflow_call + status-comment are configured (discussions enabled by default)")
612613
}
613614

614615
func TestActivationPermissionsWorkflowCallAndIssuesTriggerReaction(t *testing.T) {

0 commit comments

Comments
 (0)