-
-
Notifications
You must be signed in to change notification settings - Fork 1
117 lines (115 loc) · 10.1 KB
/
issue-pr-tracker.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Callable Issue & PR Tracker
on:
workflow_call:
jobs:
manage-project:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add Open Docker Related Issues Not Labeled Invalid
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && startsWith(github.event.repository.name, 'docker-') && ! contains(github.event.issue.labels.*.name, 'invalid') && ! contains(github.event.issue.labels.*.name, 'closed-issue-activity') }}
with:
gh_token: ${{ secrets.CR_PAT }}
organization: linuxserver
project_id: 8
resource_node_id: ${{ github.event.issue.node_id }}
status_value: 'Issues'
- name: Add Open Docker Related Issues Not Labeled Invalid (summary comment)
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && startsWith(github.event.repository.name, 'docker-') && ! contains(github.event.issue.labels.*.name, 'invalid') && ! contains(github.event.issue.labels.*.name, 'closed-issue-activity') }}
run: |
echo 'Issue [#${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) is added to [project](https://github.com/orgs/linuxserver/projects/8) column "Issues"' >> $GITHUB_STEP_SUMMARY
- name: Add Open Non-Docker Related Issues Not Labeled Invalid
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && ! startsWith(github.event.repository.name, 'docker-') && ! contains(github.event.issue.labels.*.name, 'invalid') && ! contains(github.event.issue.labels.*.name, 'closed-issue-activity') }}
with:
gh_token: ${{ secrets.CR_PAT }}
organization: linuxserver
project_id: 8
resource_node_id: ${{ github.event.issue.node_id }}
status_value: 'Non-Docker Issues'
- name: Add Open Non-Docker Related Issues Not Labeled Invalid (summary comment)
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && ! startsWith(github.event.repository.name, 'docker-') && ! contains(github.event.issue.labels.*.name, 'invalid') && ! contains(github.event.issue.labels.*.name, 'closed-issue-activity') }}
run: |
echo 'Issue [#${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) is added to [project](https://github.com/orgs/linuxserver/projects/8) column "Non-Docker Issues"' >> $GITHUB_STEP_SUMMARY
- name: Add Open Issues Labeled Invalid
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && contains(github.event.issue.labels.*.name, 'invalid') && ! contains(github.event.issue.labels.*.name, 'closed-issue-activity') }}
with:
gh_token: ${{ secrets.CR_PAT }}
organization: linuxserver
project_id: 8
resource_node_id: ${{ github.event.issue.node_id }}
status_value: 'Insufficient Info'
- name: Add Open Issues Labeled Invalid (summary comment)
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && contains(github.event.issue.labels.*.name, 'invalid') && ! contains(github.event.issue.labels.*.name, 'closed-issue-activity') }}
run: |
echo 'Issue [#${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) is added to [project](https://github.com/orgs/linuxserver/projects/8) column "Insufficient Info"' >> $GITHUB_STEP_SUMMARY
- name: Move Closed Issues and PRs to Done
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
if: ${{ github.event.issue.state == 'closed' || github.event.pull_request.state == 'closed' }}
with:
gh_token: ${{ secrets.CR_PAT }}
organization: linuxserver
project_id: 8
resource_node_id: ${{ github.event.issue.node_id || github.event.pull_request.node_id }}
status_value: 'Done'
- name: Move Closed Issues and PRs to Done (summary comment)
if: ${{ github.event.issue.state == 'closed' || github.event.pull_request.state == 'closed' }}
run: |
echo 'Issue or PR [#${{ github.event.issue.number || github.event.pull_request.number }}](${{ github.event.issue.html_url || github.event.pull_request.html_url }}) is added to [project](https://github.com/orgs/linuxserver/projects/8) column "Done"' >> $GITHUB_STEP_SUMMARY
- name: Add Open PRs Without Review Requests
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review' && github.event.pull_request.head.repo.owner.login == 'linuxserver') && github.event.pull_request.state == 'open' && github.event.pull_request.requested_reviewers[0] == null && github.event.pull_request.requested_teams[0] == null && github.event.review.state != 'approved' && ! contains(github.event.pull_request.labels.*.name, 'closed-pr-activity') }}
with:
gh_token: ${{ secrets.CR_PAT }}
organization: linuxserver
project_id: 8
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: 'PRs'
- name: Add Open PRs Without Review Requests (summary comment)
if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review' && github.event.pull_request.head.repo.owner.login == 'linuxserver') && github.event.pull_request.state == 'open' && github.event.pull_request.requested_reviewers[0] == null && github.event.pull_request.requested_teams[0] == null && github.event.review.state != 'approved' && ! contains(github.event.pull_request.labels.*.name, 'closed-pr-activity') }}
run: |
echo 'PR [#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) is added to [project](https://github.com/orgs/linuxserver/projects/8) column "PRs"' >> $GITHUB_STEP_SUMMARY
- name: Add Open PRs With Review Requests
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review' && github.event.pull_request.head.repo.owner.login == 'linuxserver') && github.event.pull_request.state == 'open' && (github.event.pull_request.requested_reviewers[0] != null || github.event.pull_request.requested_teams[0] != null) && github.event.review.state != 'approved' && ! contains(github.event.pull_request.labels.*.name, 'closed-pr-activity') }}
with:
gh_token: ${{ secrets.CR_PAT }}
organization: linuxserver
project_id: 8
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: 'PRs Ready For Team Review'
- name: Add Open PRs With Review Requests (summary comment)
if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review' && github.event.pull_request.head.repo.owner.login == 'linuxserver') && github.event.pull_request.state == 'open' && (github.event.pull_request.requested_reviewers[0] != null || github.event.pull_request.requested_teams[0] != null) && github.event.review.state != 'approved' && ! contains(github.event.pull_request.labels.*.name, 'closed-pr-activity') }}
run: |
echo 'PR [#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) is added to [project](https://github.com/orgs/linuxserver/projects/8) column "PRs Ready For Team Review"' >> $GITHUB_STEP_SUMMARY
- name: Move Approved PRs
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review' && github.event.pull_request.head.repo.owner.login == 'linuxserver') && github.event.pull_request.state == 'open' && github.event.review.state == 'approved' && ! contains(github.event.pull_request.labels.*.name, 'closed-pr-activity') }}
with:
gh_token: ${{ secrets.CR_PAT }}
organization: linuxserver
project_id: 8
resource_node_id: ${{ github.event.pull_request.node_id }}
status_value: 'PRs Approved'
- name: Move Approved PRs (summary comment)
if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request_review' && github.event.pull_request.head.repo.owner.login == 'linuxserver') && github.event.pull_request.state == 'open' && github.event.review.state == 'approved' && ! contains(github.event.pull_request.labels.*.name, 'closed-pr-activity') }}
run: |
echo 'PR [#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) is added to [project](https://github.com/orgs/linuxserver/projects/8) column "PRs Approved"' >> $GITHUB_STEP_SUMMARY
- name: Add Comment on Invalid Labeling
uses: peter-evans/create-or-update-comment@v4.0.0
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && github.event.label.name == 'invalid' && contains(github.event.issue.labels.*.name, 'invalid') && ! contains(github.event.issue.labels.*.name, 'closed-pr-activity') }}
with:
issue-number: ${{ github.event.issue.number}}
body: |
A human has marked this issue as invalid, this likely happened because the issue template was not used in the creation of the issue.
- name: Add Comment on Invalid Labeling (summary comment)
if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && github.event.label.name == 'invalid' && contains(github.event.issue.labels.*.name, 'invalid') && ! contains(github.event.issue.labels.*.name, 'closed-pr-activity') }}
run: |
echo 'Commented on issue [#${{ github.event.issue.number }}](${{ github.event.issue.html_url }}) that was marked invalid' >> $GITHUB_STEP_SUMMARY
- name: Ignore Review Event On 3rd Party PRs
if: ${{ github.event_name == 'pull_request_review' && github.event.pull_request.head.repo.owner.login != 'linuxserver' }}
run: |
echo 'Skipping PR review action on 3rd party PR due to Github token permission limitation.' >> $GITHUB_STEP_SUMMARY