Add issues:write permission to create-discussion jobs for fallback support#13907
Merged
Add issues:write permission to create-discussion jobs for fallback support#13907
Conversation
…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
pelikhan
approved these changes
Feb 5, 2026
Contributor
There was a problem hiding this comment.
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 grantscontents: read,issues: write, anddiscussions: writepermissions - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
create-discussionsafe output includes afallback-to-issuefeature (enabled by default) that creates an issue when discussion creation fails due to permissions. The job lackedissues: writepermission, causing fallback failures.Changes
NewPermissionsContentsReadIssuesWriteDiscussionsWrite()grantscontents: read,issues: write, anddiscussions: writeNewPermissionsContentsReadDiscussionsWrite()CreateDiscussionsis configuredResult
All create-discussion jobs now have required permissions for both primary (discussion creation) and fallback (issue creation) paths:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.