Mark stale issues and pull requests #714
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Mark stale issues and pull requests | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # Runs at midnight UTC every day | |
| permissions: | |
| contents: read | |
| jobs: | |
| stale: | |
| permissions: | |
| issues: write # for actions/stale to close stale issues | |
| pull-requests: write # for actions/stale to close stale PRs | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| staled_prs: ${{ steps.filter-prs.outputs.result }} | |
| steps: | |
| - uses: actions/stale@v10 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| stale-pr-message: "Данный PR считается устаревшим, так как не обновлялся достаточно долгое время. Это означает, что он будет автоматически закрыт в течении 7 дней. Если это ошибка и PR в разработке, то сообщите об этом @Ревьювер в Discord." | |
| close-pr-message: "Этот PR не получил обновлений после того, как был помечен как устаревший, и поэтому автоматически закрыт. Вы можете переоткрыть этот PR или создать новый, когда у вас появятся новые обновления." | |
| days-before-stale: 14 | |
| days-before-close: 7 | |
| #days-before-issue-stale: 14 | |
| #days-before-issue-close: 14 | |
| stale-pr-label: "💀 Устаревший" | |
| #stale-issue-label: "Stale" | |
| #any-of-issue-labels: "Cleanup Flagged,🤖 Flaky Test Report" | |
| #remove-issue-stale-when-updated: false | |
| #exempt-issue-labels: "RED LABEL" | |
| exempt-pr-labels: "🛑 Не закрывать" | |
| operations-per-run: 300 | |
| announce: | |
| runs-on: ubuntu-24.04 | |
| needs: stale | |
| if: ${{ needs.stale.outputs.staled_prs != '[]' }} | |
| strategy: | |
| matrix: | |
| pull_request: ${{ fromJSON(needs.stale.outputs.staled_prs) }} | |
| steps: | |
| - name: "Check for DISCORD_WEBHOOK" | |
| id: secrets_set | |
| env: | |
| ENABLER_SECRET: ${{ secrets.DISCORD_WEBHOOK }} | |
| run: | | |
| unset SECRET_EXISTS | |
| if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi | |
| echo "SECRETS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT | |
| - name: Send Discord notification | |
| uses: tgstation/discord-notify@v3 | |
| if: > | |
| steps.secrets_set.outputs.SECRETS_ENABLED | |
| with: | |
| webhook_url: ${{ secrets.DISCORD_WEBHOOK }} | |
| title: ${{ matrix.pull_request.title }} | |
| message: ${{ format('**PR \#{0} автоматически помечается как устаревший.**', matrix.pull_request.number) }} | |
| include_image: false | |
| show_author: false | |
| avatar_url: https://cdn.discordapp.com/attachments/1284433984666734603/1403077083076366546/1984.png?ex=68963cdc&is=6894eb5c&hm=7f654bcb85dec940417a6e393b461382e7284d545f8336807bc753a38b040e01& | |
| username: Почтальон | |
| title_url: "${{ matrix.pull_request.html_url }}" |