Skip to content

Add issues:write permission to create-discussion jobs for fallback support#13907

Merged
pelikhan merged 3 commits intomainfrom
copilot/update-fallback-issue-creation-route
Feb 5, 2026
Merged

Add issues:write permission to create-discussion jobs for fallback support#13907
pelikhan merged 3 commits intomainfrom
copilot/update-fallback-issue-creation-route

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

The create-discussion safe output includes a fallback-to-issue feature (enabled by default) that creates an issue when discussion creation fails due to permissions. The job lacked issues: write permission, causing fallback failures.

Changes

  • New permission factory: NewPermissionsContentsReadIssuesWriteDiscussionsWrite() grants contents: read, issues: write, and discussions: write
  • Updated create_discussion job: Uses new permission function instead of NewPermissionsContentsReadDiscussionsWrite()
  • Updated aggregated safe_outputs job: Merges correct permissions when CreateDiscussions is configured

Result

All create-discussion jobs now have required permissions for both primary (discussion creation) and fallback (issue creation) paths:

safe_outputs:
  permissions:
    contents: read
    discussions: write
    issues: write  # Added for fallback-to-issue support
Original prompt

Reference: https://github.com/github/gh-aw/actions/runs/21689598271/job/62546849702#step:6:1

the fallback issue creation route for the create-discussion safe output requires the issue: write permission in the safe output job.

Also make sure that the discussions: write permission is set.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 5, 2026 13:30
…e support

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update fallback issue creation route permissions Add issues:write permission to create-discussion jobs for fallback support Feb 5, 2026
Copilot AI requested a review from pelikhan February 5, 2026 13:41
@pelikhan pelikhan marked this pull request as ready for review February 5, 2026 13:43
Copilot AI review requested due to automatic review settings February 5, 2026 13:43
@pelikhan pelikhan merged commit a4b3e8c into main Feb 5, 2026
117 checks passed
@pelikhan pelikhan deleted the copilot/update-fallback-issue-creation-route branch February 5, 2026 13:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the issues: write permission to create-discussion jobs to support the fallback-to-issue feature. When discussion creation fails due to permissions (e.g., discussions not enabled), the job falls back to creating an issue instead. This fallback feature is enabled by default but requires the issues: write permission to function properly.

Changes:

  • Added new permission factory function NewPermissionsContentsReadIssuesWriteDiscussionsWrite() that grants contents: read, issues: write, and discussions: write permissions
  • Updated create-discussion job generation to use the new permission function
  • Updated consolidated safe_outputs job to merge correct permissions when CreateDiscussions is configured

Reviewed changes

Copilot reviewed 50 out of 50 changed files in this pull request and generated no comments.

File Description
pkg/workflow/permissions_factory.go Added new permission factory function for create-discussion jobs with fallback-to-issue support
pkg/workflow/create_discussion.go Updated to use new permission function that includes issues: write
pkg/workflow/compiler_safe_outputs_job.go Updated consolidated safe outputs job to use new permission function for CreateDiscussions
.github/workflows/*.lock.yml (54 files) Regenerated workflow lock files with updated permissions (added issues: write)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants