blender/.github/workflows/stale.yml
Bart van der Braak ceeaea0c8a Fix: Switch to scheduled trigger for appropriate permission scope in workflow
Previously, the workflow was triggered by **opened pull requests** events.
However, testing revealed that this event, initiated by external GitHub users,
lacks the permission scope to comment on or close pull requests.

To address this, I've updated the workflow to trigger on a schedule. Scheduled
triggers aren't tied to external actors, thereby ensuring the necessary
permission scopes are available.

Pull Request: https://projects.blender.org/blender/blender/pulls/122363
2024-05-28 14:12:20 +02:00

33 lines
1.3 KiB
YAML

# GitHub Actions workflow for automatically closing pull requests
# This workflow is specific to Blender's GitHub mirror and directs contributors to the official development platform on blender.org
name: Close GitHub Pull Requests
# Trigger this workflow every 12 hours.
on:
schedule:
- cron: '* */12 * * *'
jobs:
close_prs:
name: Close Pull Requests
runs-on: ubuntu-latest
# Only run this job in the read-only mirror repository.
if: github.repository == 'blender/blender' && contains(github.server_url, 'github.com')
# Permissions granted to the GitHub Actions bot.
permissions:
pull-requests: write
steps:
- uses: actions/stale@v9
with:
# Number of days before a pull request is marked as stale.
days-before-pr-stale: 0
# Number of days before a pull request is closed.
days-before-pr-close: 0
# Message posted when closing a pull request.
stale-pr-message: |
This pull request has been automatically closed because this repository is a read-only mirror. Blender development happens on [projects.blender.org](https://projects.blender.org).
To contribute code, please read:
https://developer.blender.org/docs/handbook/contributing/