1
+ name : Issue & PR Automation
2
+
3
+ on :
4
+ issues :
5
+ types :
6
+ - opened
7
+ - reopened
8
+ pull_request_target :
9
+ types :
10
+ - opened
11
+ - reopened
12
+ - review_requested
13
+
14
+ env :
15
+ PRIMARY_CODEOWNER : ' @thomasplevy'
16
+ PROJECT_ORG : gocodebox
17
+ PROJECT_ID : 18
18
+
19
+ jobs :
20
+
21
+ # ######################################
22
+ # Add issue to the Development project.
23
+ # ######################################
24
+ issue-to-project :
25
+ name : Move Issue to Project Board
26
+ runs-on : ubuntu-latest
27
+ if : ( 'issues' == github.event_name && ( 'opened' == github.event.action || 'reopened' == github.event.action ) )
28
+ steps :
29
+ - name : Add Issue to Project
30
+ uses :
leonsteinhaeuser/[email protected]
31
+ with :
32
+ gh_token : ${{ secrets.ORG_WORKFLOWS }}
33
+ organization : ${{ env.PROJECT_ORG }}
34
+ project_id : ${{ env.PROJECT_ID }}
35
+ resource_node_id : ${{ github.event.issue.node_id }}
36
+ status_value : " Awaiting Triage"
37
+
38
+ # - uses: hmarr/debug-action@v2
39
+
40
+ # ###################################
41
+ # Assign to the project's CODEOWNER.
42
+ # ###################################
43
+ issue-assig :
44
+ name : Assign Issue to the Primary CODEOWNER
45
+ runs-on : ubuntu-latest
46
+ if : ( 'issues' == github.event_name && ( 'opened' == github.event.action || 'reopened' == github.event.action ) && ( null == github.event.issue.assignee ) )
47
+ steps :
48
+ - name : Check CODEOWNERS file existence
49
+ id : codeowners_file_exists
50
+ uses : andstor/file-existence-action@v1
51
+ with :
52
+ files : .github/CODEOWNERS
53
+
54
+ - name : Parse CODEOWNERS file
55
+ id : codeowner
56
+ if : steps.codeowners_file_exists.outputs.files_exists == 'true'
57
+ uses : SvanBoxel/codeowners-action@v1
58
+ with :
59
+ path : .github/CODEOWNERS
60
+
61
+ - name : Update PRIMARY_CODEOWNER env var
62
+ if : steps.codeowners_file_exists.outputs.files_exists == 'true'
63
+ run : |
64
+ echo PRIMARY_CODEOWNER=$( echo '${{ steps.codeowner.outputs.codeowners }}' | jq -r '."*"[0]' ) >> $GITHUB_ENV
65
+
66
+ - name : Strip @ from username
67
+ run : |
68
+ echo "PRIMARY_CODEOWNER=${PRIMARY_CODEOWNER#?}" >> $GITHUB_ENV
69
+
70
+ - name : Assign issue
71
+ uses : pozil/auto-assign-issue@v1
72
+ with :
73
+ repo-token : ${{ secrets.ORG_WORKFLOWS }}
74
+ assignees : ${{ env.PRIMARY_CODEOWNER }}
75
+
76
+ # ####################################
77
+ # Add PRs to the Development project.
78
+ # ####################################
79
+ pr-to-board :
80
+ name : Move Pull Request to the Project Board
81
+ runs-on : ubuntu-latest
82
+ if : ( 'pull_request' == github.event_name && ( 'opened' == github.event.action || 'reopened' == github.event.action || 'review_requested' == github.event.action ) )
83
+ steps :
84
+ - name : Mark PR as Awaiting Review
85
+ uses :
leonsteinhaeuser/[email protected]
86
+ with :
87
+ gh_token : ${{ secrets.ORG_WORKFLOWS }}
88
+ organization : ${{ env.PROJECT_ORG }}
89
+ project_id : ${{ env.PROJECT_ID }}
90
+ resource_node_id : ${{ github.event.pull_request.node_id }}
91
+ status_value : " Awaiting Review"
0 commit comments