name: Close stale issues

on:
  schedule:
  - cron: "10 0 * * *"
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  FORCE_COLOR: 1

jobs:
  stale:
    if: github.event.repository.fork == false
    permissions:
      issues: write

    runs-on: ubuntu-slim

    steps:
    - name: "Check issues"
      uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        only-labels: "Awaiting OP Action"
        close-issue-message: "Closing this issue as no feedback has been received."
        days-before-stale: 7
        days-before-issue-close: 0
        days-before-pr-close: -1
        labels-to-remove-when-unstale: "Awaiting OP Action"
