Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/reopen-issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Reopen issue on command"
on:
issue_comment:
types: [created]

permissions:
contents: read

jobs:
reopen:
# Only run on issues (not PRs), on closed issues, when the comment is exactly "/reopen",
# and only if the commenter is the issue author or a member/collaborator/owner/contributor.
if: >
!github.event.issue.pull_request &&
github.event.issue.state == 'closed' &&
startsWith(github.event.comment.body, '/reopen') &&
(
github.event.comment.user.login == github.event.issue.user.login ||
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), github.event.comment.author_association)
)
permissions:
issues: write # required to reopen the issue
runs-on: ubuntu-latest
steps:
- name: Reopen issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
COMMENT_BODY: ${{ github.event.comment.body }}
run: |
# Require the comment to be exactly "/reopen" (ignoring trailing whitespace)
if [[ ! "$COMMENT_BODY" =~ ^/reopen[[:space:]]*$ ]]; then
echo "Comment is not an exact /reopen command; skipping."
exit 0
fi
gh issue reopen "$ISSUE_NUMBER" --repo "$REPO"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Close stale pull requests"
name: "Close stale pull requests and issues"
on:
schedule:
- cron: "12 3 * * *" # arbitrary time not to DDOS GitHub
Expand All @@ -10,6 +10,7 @@ jobs:
stale:
permissions:
pull-requests: write # required for marking and closing stale PRs
issues: write # required for marking and closing stale issues
actions: write # required for the stale action to manage (reset) its state cache
runs-on: ubuntu-latest
steps:
Expand All @@ -19,9 +20,17 @@ jobs:
stale-pr-message: 'This PR was marked stale. It will be closed in 14 days without additional activity.'
close-pr-message: 'Closed as inactive. Feel free to reopen if this PR is still being worked on.'
exempt-pr-labels: 'release:after-ga'
# opt out of defaults to avoid marking issues as stale
days-before-stale: -1
days-before-close: -1
# overrides the above only for pull requests
stale-issue-message: 'This issue was marked stale due to lack of activity. Please leave a comment if you would like to keep this issue open.'
close-issue-message: |
Closed due to inactivity.

We appreciate your input, and if this issue is still relevant,
please reopen it, or comment "/reopen" and we'll do it for you.

Thank you for your contribution!
# applies only to pull requests
days-before-pr-stale: 14
days-before-pr-close: 14
# applies only to issues
days-before-issue-stale: 365
days-before-issue-close: 14
Loading