-
-
Notifications
You must be signed in to change notification settings - Fork 484
46 lines (39 loc) · 1.3 KB
/
pr-automation.yml
File metadata and controls
46 lines (39 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: PR Automation
on:
pull_request_target:
types: [opened, synchronize, reopened, edited]
schedule:
# Run daily at 00:00 UTC to check for stale PRs
- cron: '0 0 * * *'
workflow_dispatch: # Allow manual trigger
permissions:
pull-requests: write
issues: write
contents: read
jobs:
check-issue-reference:
name: Check for Issue Reference
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Check for issue reference in PR body or title
env:
GH_TOKEN: ${{ github.token }}
run: |
chmod +x .github/scripts/check-issue-reference.sh
.github/scripts/check-issue-reference.sh ${{ github.event.pull_request.number }}
close-stale-prs:
name: Close PRs Without Successful Build
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Close PRs without successful build after 3 days
env:
GH_TOKEN: ${{ github.token }}
run: |
chmod +x .github/scripts/close-stale-prs.sh
.github/scripts/close-stale-prs.sh