Automatically closes all sub-issues associated with a parent issue when the parent is closed.
- Automatically closes all open sub-issues when parent issue is closed
- Adds a summary comment to the parent issue listing closed sub-issues
- Handles large numbers of sub-issues safely with pagination
Add this workflow to your repository at .github/workflows/close-sub-issues.yml:
name: Close Sub-Issues
on:
issues:
types: [closed]
permissions:
issues: write # Required to close issues and add comments
contents: read # Required to access repository
jobs:
close-sub-issues:
runs-on: ubuntu-latest
steps:
- name: Close Sub-Issues
uses: RehabAbotalep/close-sub-issues-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
issue_number: ${{ github.event.issue.number }}
repository: ${{ github.repository }}This action requires the following permissions to work correctly:
| Permission | Reason |
|---|---|
issues: write |
Required to close sub-issues and add comments to the parent issue |
contents: read |
Required to access repository information |
Note: If you encounter a
403 - Resource not accessible by integrationerror, make sure you've added thepermissionsblock to your workflow file as shown above.
| Input | Description | Required |
|---|---|---|
github_token |
GitHub token for authentication | Yes |
issue_number |
The issue number of the parent issue | Yes |
repository |
The repository in owner/repo format |
Yes |
| Output | Description |
|---|---|
closed_count |
The number of sub-issues that were successfully closed |
total_count |
The total number of sub-issues found |
When a parent issue is closed, this action will:
- Find all open sub-issues
- Close each sub-issue
- Add a comment to the parent issue:
✅ Automatically closed the following sub-issues: #2 #3 #4
MIT