Skip to content

safe-outputs create-discussion does not apply configured labels #15595

Description

@rspurgeon

Summary

safe-outputs.create-discussion.labels appears to be accepted in config but not applied to newly created discussions.

What I observed

The create_discussion handler parses config.labels, but those labels are never used when creating the discussion.

Expected behavior

When safe-outputs.create-discussion.labels is configured, created discussions should receive those labels.

Actual behavior

Discussion is created successfully, but no labels are applied.

Reproduction

  1. Configure workflow safe-outputs with create-discussion and labels:
safe-outputs:
  create-discussion:
    category: announcements
    labels: [automation, report]
  1. Emit a valid create_discussion output item.
  2. Observe created discussion has no labels.

Code evidence

  • create_discussion parses labels from config, but does not use them later:
    • actions/setup/js/create_discussion.cjs:196
  • Discussion creation GraphQL mutation only sends repositoryId, categoryId, title, and body:
    • actions/setup/js/create_discussion.cjs:405
  • By contrast, create_issue builds and passes labels to API create call:
    • actions/setup/js/create_issue.cjs:376
    • actions/setup/js/create_issue.cjs:469
  • Schema/docs indicate labels should be attached to created discussions:
    • pkg/parser/schemas/main_workflow_schema.json:4364
    • pkg/workflow/create_discussion.go:18

Likely root cause

The discussion creation path lacks a label-attachment step (either during createDiscussion input if supported, or a follow-up mutation to apply labels after creation).

Suggested fix

After discussion creation, resolve label IDs for configured labels and apply them to the created discussion node (or include label IDs directly if supported by the create mutation input).

Impact

Workflows depending on discussion labels for triage, filtering, and close-older-discussions matching do not behave as configured.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions