-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add unlock functionality for reopened issues and PRs in locker workflow #119003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unlock functionality for reopened issues and PRs in locker workflow #119003
Conversation
…rkflow Co-authored-by: akoeplinger <[email protected]>
|
@copilot you don't need to have a separate step for pull requests since they're treated as issues by GitHub already. Use code like this to unlock the pr/issue: |
|
@copilot oh and use the |
… logic Co-authored-by: akoeplinger <[email protected]>
Updated the workflow to use |
|
/ba-g only change to a GitHub Action so no AzDO builds got triggered |
There was a problem hiding this 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 enhances the GitHub Actions locker workflow to automatically unlock issues and pull requests when they are reopened, ensuring that previously locked conversations become accessible again when discussion resumes.
Key changes:
- Added event triggers for
issues.reopenedandpull_request_target.reopened - Split workflow into separate lock and unlock jobs with appropriate conditions
- Implemented unlock functionality using GitHub REST API
Co-authored-by: Copilot <[email protected]>
|
/ba-g only change to a GitHub Action so no AzDO builds got triggered |
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
|
@jeffhandley FYI that we will have a workflow that unlocks reopened issues and PRs for external contributors. Does this look right to you? |
jeffhandley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suuuuuper late to review, but yes this looks good, @ViktorHofer; thanks!
This PR enhances the
.github/workflows/locker.ymlworkflow to automatically unlock issues and pull requests when they are reopened, addressing the need to make previously locked items accessible again when discussion resumes.Changes Made
New Event Triggers
issues.reopenedtrigger to detect when closed issues are reopenedpull_request_target.reopenedtrigger to detect when closed PRs are reopenedEnhanced Job Logic
Lock job (renamed from
mainfor clarity):github.event_name != 'issues' && github.event_name != 'pull_request_target'New unlock job:
github.event.action == 'reopened'actions/github-script@v7with GitHub REST API to unlock itemsgithub.event.issue.locked == trueWorkflow Behavior
Technical Implementation
The unlock functionality uses the GitHub Issues API (which also handles PRs) through
actions/github-script@v7:This ensures that when maintainers or contributors reopen issues or PRs for continued discussion, they won't encounter locked conversation threads that prevent community engagement.
Fixes the workflow gap where reopened items remained inaccessible for comments despite being active again.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.