Skip to content

github action: close manually marked stale issues/prs after 7 days#12812

Merged
Maffooch merged 1 commit into
DefectDojo:bugfixfrom
valentijnscholten:stale-action
Jul 21, 2025
Merged

github action: close manually marked stale issues/prs after 7 days#12812
Maffooch merged 1 commit into
DefectDojo:bugfixfrom
valentijnscholten:stale-action

Conversation

@valentijnscholten

Copy link
Copy Markdown
Member

Adds a daily job to close any issues or PRs that have been marked as stale. We don't automatically mark these as stale, but we can mark them manually as stale. This means they'll get closed after 7 days of inactivity.

@valentijnscholten valentijnscholten added this to the 2.48.2 milestone Jul 20, 2025
@dryrunsecurity

Copy link
Copy Markdown

DryRun Security

This pull request contains a GitHub workflow for closing stale issues and pull requests, which has appropriately scoped write permissions and follows good security practices with no identified risks.

Workflow Permissions in .github/workflows/close-stale.yml
Vulnerability Workflow Permissions
Description While the workflow has write permissions for issues and PRs, these are appropriately scoped to the action's intended purpose of closing stale items. The workflow requires a manual 'stale' label and provides clear closure messages. No direct evidence of abuse potential was found.

name: Close Stale Issues and PRs
on:
schedule:
# Run daily at 02:00 UTC
- cron: '0 2 * * *'
workflow_dispatch:
# Allow manual triggering
permissions:
issues: write
pull-requests: write
jobs:
close-stale:
runs-on: ubuntu-latest
steps:
- name: Close stale issues and PRs
uses: actions/stale@v9
with:
# Disable automatic stale marking - only close manually labeled items
days-before-stale: -1
days-before-close: 7
stale-issue-label: 'stale'
stale-pr-label: 'stale'
close-issue-message: 'This issue has been automatically closed because it was manually labeled as stale. If you believe this was closed in error, please reopen it and remove the stale label.'
close-pr-message: 'This PR has been automatically closed because it was manually labeled as stale. If you believe this was closed in error, please reopen it and remove the stale label.'


All finding details can be found in the DryRun Security Dashboard.

@mtesauro mtesauro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved

@Maffooch Maffooch merged commit 0d8cdfa into DefectDojo:bugfix Jul 21, 2025
84 checks passed
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.

5 participants