|
2 | 2 | # Dynamically inserts status badges into PR description, based on certain conditions
|
3 | 3 |
|
4 | 4 | # Checks if the required sections are missing
|
5 |
| -- label: "⚠️Missing" |
6 |
| - message: "Category" |
7 |
| - color: "#f25265" |
8 |
| - when: "$payload.pull_request.body.includes('Category') === false" |
9 |
| -- label: "⚠️Missing" |
10 |
| - message: "Overview" |
11 |
| - color: "#f25265" |
12 |
| - when: "$payload.pull_request.body.includes('Overview') === false" |
13 |
| -- label: "⚠️Missing" |
14 |
| - message: "Quality Checklist" |
15 |
| - color: "#f25265" |
16 |
| - when: "$payload.pull_request.body.includes('Code Quality Checklist') === false" |
17 |
| -- label: "⚠️Description" |
18 |
| - message: "Incomplete" |
19 |
| - color: "#f25265" |
20 |
| - when: "$payload.pull_request.body.length < 25" |
21 |
| -- label: "⚠️Missing" |
22 |
| - message: "Label" |
23 |
| - color: "#f25265" |
24 |
| - when: "$labels.length == 0" |
| 5 | +- label: ⚠️Missing |
| 6 | + message: Category |
| 7 | + color: '#f25265' |
| 8 | + when: $payload.pull_request.body.includes('Category') === false |
| 9 | +- label: ⚠️Missing |
| 10 | + message: Overview |
| 11 | + color: '#f25265' |
| 12 | + when: $payload.pull_request.body.includes('Overview') === false |
| 13 | +- label: ⚠️Missing |
| 14 | + message: Quality Checklist |
| 15 | + color: '#f25265' |
| 16 | + when: $payload.pull_request.body.includes('Code Quality Checklist') === false |
| 17 | +- label: ⚠️Description |
| 18 | + message: Incomplete |
| 19 | + color: '#f25265' |
| 20 | + when: $payload.pull_request.body.length < 25 |
| 21 | +- label: ⚠️Missing |
| 22 | + message: Label |
| 23 | + color: '#f25265' |
| 24 | + when: $labels.length == 0 |
25 | 25 |
|
26 | 26 | # Show note when task list has unfinished items
|
27 |
| -- label: "⚠️Notice" |
28 |
| - message: "Unchecked Tasks" |
29 |
| - when: "$payload.pull_request.body.includes('- [ ] ')" |
30 |
| - color: "#f25265" |
| 27 | +- label: ⚠️Notice |
| 28 | + message: Unchecked Tasks |
| 29 | + when: $payload.pull_request.body.includes('- [ ] ') |
| 30 | + color: '#f25265' |
31 | 31 |
|
32 | 32 | # Show badge indicating PR status
|
33 |
| -- label: "Status" |
34 |
| - message: "✏️ Draft" |
35 |
| - when: "$isDraft" |
36 |
| - color: "#ffa933" |
37 |
| -- label: "Status" |
38 |
| - message: "🧱 Work in Progress" |
39 |
| - when: "$payload.pull_request.title.includes('WIP')" |
40 |
| - color: "#29e3f4" |
41 |
| -- label: "Status" |
42 |
| - message: "✅ Ready" |
43 |
| - color: "#3ef963" |
44 |
| - when: "$labels.includes('🔀 Ready for Merge')" |
| 33 | +- label: Status |
| 34 | + message: ✏️ Draft |
| 35 | + when: $isDraft |
| 36 | + color: '#ffa933' |
| 37 | +- label: Status |
| 38 | + message: 🧱 Work in Progress |
| 39 | + when: $payload.pull_request.title.includes('WIP') |
| 40 | + color: '#29e3f4' |
| 41 | +- label: Status |
| 42 | + message: ✅ Ready |
| 43 | + color: '#3ef963' |
| 44 | + when: $labels.includes('🔀 Ready for Merge') |
45 | 45 |
|
46 | 46 | # Add size label based on very large or tiny PRs
|
47 |
| -- label: "PR Size" |
48 |
| - message: "Extra Large" |
49 |
| - color: "#f9833e" |
50 |
| - when: "$additions > 1000" |
51 |
| -- label: "PR Size" |
52 |
| - message: "Large" |
53 |
| - color: "#f4b546" |
54 |
| - when: "$additions > 500 && $additions < 1000" |
55 |
| -- label: "PR Size" |
56 |
| - message: "Medium" |
57 |
| - color: "#f3ff59" |
58 |
| - when: "$additions > 10 && $additions < 500" |
59 |
| -- label: "PR Size" |
60 |
| - message: "Quick" |
61 |
| - color: "#3eef8b" |
62 |
| - when: "$additions < 10" |
| 47 | +- label: PR Size |
| 48 | + message: Extra Large |
| 49 | + color: '#f9833e' |
| 50 | + when: '$additions > 1000' |
| 51 | +- label: PR Size |
| 52 | + message: Large |
| 53 | + color: '#f4b546' |
| 54 | + when: '$additions > 500 && $additions < 1000' |
| 55 | +- label: PR Size |
| 56 | + message: Medium |
| 57 | + color: '#f3ff59' |
| 58 | + when: '$additions > 10 && $additions < 500' |
| 59 | +- label: PR Size |
| 60 | + message: Quick |
| 61 | + color: '#3eef8b' |
| 62 | + when: '$additions < 10' |
63 | 63 |
|
64 | 64 | # Show PR number, to destination and from destination
|
65 |
| -- label: "#$prNumber" |
66 |
| - message: "$payload.pull_request.user.login /$payload.pull_request.head.ref → $payload.repository.full_name" |
67 |
| - color: "#ab5afc" |
68 |
| - url: "https://github.com/$slug/tree/$branchName" |
| 65 | +- label: '#$prNumber' |
| 66 | + message: '$payload.pull_request.user.login /$payload.pull_request.head.ref → $payload.repository.full_name' |
| 67 | + color: '#ab5afc' |
| 68 | + url: 'https://github.com/$slug/tree/$branchName' |
69 | 69 |
|
70 | 70 | # Show total code added minus deleted
|
71 |
| -- label: "New Code" |
72 |
| - message: "Commits: $payload.pull_request.commits | Files Changed: $payload.pull_request.changed_files | Additions: $payload.pull_request.additions-$payload.pull_request.deletions" |
73 |
| - color: "#dddd00" |
| 71 | +- label: New Code |
| 72 | + message: 'Commits: $payload.pull_request.commits | Files Changed: $payload.pull_request.changed_files | Additions: $payload.pull_request.additions-$payload.pull_request.deletions' |
| 73 | + color: '#dddd00' |
74 | 74 |
|
75 | 75 | # Show submitting user's username and profile link
|
76 | 76 | - label: 💕 Submitted by
|
77 |
| - message: "$payload.pull_request.user.login" |
78 |
| - color: "#f73ae6" |
79 |
| - when: "$payload.pull_request.author_association !== 'OWNER'" |
80 |
| - url: "https://github.com/$payload.pull_request.user.login" |
| 77 | + message: $payload.pull_request.user.login |
| 78 | + color: '#f73ae6' |
| 79 | + when: $payload.pull_request.author_association !== 'OWNER' |
| 80 | + url: 'https://github.com/$payload.pull_request.user.login' |
81 | 81 |
|
82 | 82 | # Show a badge indicating the PR category, based on tag
|
83 |
| -- label: "Type" |
84 |
| - message: "✨ Feature" |
85 |
| - color: "#39b0fd" |
86 |
| - when: "$labels.includes('✨ New Feature')" |
87 |
| -- label: "Type" |
88 |
| - message: "🐛 Fix" |
89 |
| - color: "#39b0fd" |
90 |
| - when: "$labels.includes('🦋 Bug Fix')" |
91 |
| -- label: "Type" |
92 |
| - message: "📕 Docs" |
93 |
| - color: "#39b0fd" |
94 |
| - when: "$labels.includes('📕 Docs')" |
95 |
| -- label: "Type" |
96 |
| - message: "🛠️ Build Changes" |
97 |
| - color: "#39b0fd" |
98 |
| - when: "$labels.includes('🛠️ Build Changes')" |
99 |
| -- label: "Type" |
100 |
| - message: "🛠️ Build Changes" |
101 |
| - color: "#39b0fd" |
102 |
| - when: "$labels.includes('🛠️ Build Changes')" |
103 |
| -- label: "Type" |
104 |
| - message: "🚚 Refactor" |
105 |
| - color: "#39b0fd" |
106 |
| - when: "$labels.includes('🚚 Refactor')" |
107 |
| -- label: "Type" |
108 |
| - message: "💄 Stylistic Changes" |
109 |
| - color: "#39b0fd" |
110 |
| - when: "$labels.includes('💄 Stylistic Changes')" |
111 |
| -- label: "Type" |
112 |
| - message: "🌟 Showcase Addition" |
113 |
| - color: "#39b0fd" |
114 |
| - when: "$labels.includes('💯 Showcase')" |
115 |
| -- label: "Type" |
116 |
| - message: "🏗️ Architecture" |
117 |
| - color: "#39b0fd" |
118 |
| - when: "$labels.includes('🏗️ Architectural Changes')" |
119 |
| -- label: "Type" |
120 |
| - message: "🤖 Auto Submission" |
121 |
| - color: "#39b0fd" |
122 |
| - when: "$labels.includes('🤖 Auto')" |
123 |
| -- label: "Type" |
124 |
| - message: "🌐 Language Update" |
125 |
| - color: "#39b0fd" |
126 |
| - when: "$labels.includes('🌐 Language')" |
| 83 | +- label: Type |
| 84 | + message: ✨ Feature |
| 85 | + color: '#39b0fd' |
| 86 | + when: $labels.includes('✨ New Feature') |
| 87 | +- label: Type |
| 88 | + message: 🐛 Fix |
| 89 | + color: '#39b0fd' |
| 90 | + when: $labels.includes('🦋 Bug Fix') |
| 91 | +- label: Type |
| 92 | + message: 📕 Docs |
| 93 | + color: '#39b0fd' |
| 94 | + when: $labels.includes('📕 Docs') |
| 95 | +- label: Type |
| 96 | + message: 🛠️ Build Changes |
| 97 | + color: '#39b0fd' |
| 98 | + when: $labels.includes('🛠️ Build Changes') |
| 99 | +- label: Type |
| 100 | + message: 🛠️ Build Changes |
| 101 | + color: '#39b0fd' |
| 102 | + when: $labels.includes('🛠️ Build Changes') |
| 103 | +- label: Type |
| 104 | + message: 🚚 Refactor |
| 105 | + color: '#39b0fd' |
| 106 | + when: $labels.includes('🚚 Refactor') |
| 107 | +- label: Type |
| 108 | + message: 💄 Stylistic Changes |
| 109 | + color: '#39b0fd' |
| 110 | + when: $labels.includes('💄 Stylistic Changes') |
| 111 | +- label: Type |
| 112 | + message: 🌟 Showcase Addition |
| 113 | + color: '#39b0fd' |
| 114 | + when: $labels.includes('💯 Showcase') |
| 115 | +- label: Type |
| 116 | + message: 🏗️ Architecture |
| 117 | + color: '#39b0fd' |
| 118 | + when: $labels.includes('🏗️ Architectural Changes') |
| 119 | +- label: Type |
| 120 | + message: 🤖 Auto Submission |
| 121 | + color: '#39b0fd' |
| 122 | + when: $labels.includes('🤖 Auto') |
| 123 | +- label: Type |
| 124 | + message: 🌐 Language Update |
| 125 | + color: '#39b0fd' |
| 126 | + when: $labels.includes('🌐 Language') |
127 | 127 |
|
128 | 128 | # Show warning, when certain tags are applied
|
129 |
| -- label: "Warning" |
130 |
| - message: "⛔ Do Not Merge" |
131 |
| - color: "#f25265" |
132 |
| - when: "$labels.includes('⛔ Don't Merge')" |
133 |
| -- label: "Warning" |
134 |
| - message: "🚫 Merge Conflicts" |
135 |
| - color: "#f25265" |
136 |
| - when: "$labels.includes('🚫 Merge Conflicts')" |
137 |
| -- label: "Warning" |
138 |
| - message: "🕸️ Inactive" |
139 |
| - color: "#f25265" |
140 |
| - when: "$labels.includes('🕸️ Inactive')" |
141 |
| -- label: "Warning" |
142 |
| - message: "💀 Spam" |
143 |
| - color: "#f25265" |
144 |
| - when: "$labels.includes('💀 Spam')" |
| 129 | +- label: Warning |
| 130 | + message: ⛔ Do Not Merge |
| 131 | + color: '#f25265' |
| 132 | + when: $labels.includes("⛔ Don't Merge") |
| 133 | +- label: Warning |
| 134 | + message: 🚫 Merge Conflicts |
| 135 | + color: '#f25265' |
| 136 | + when: $labels.includes('🚫 Merge Conflicts') |
| 137 | +- label: Warning |
| 138 | + message: 🕸️ Inactive |
| 139 | + color: '#f25265' |
| 140 | + when: $labels.includes('🕸️ Inactive') |
| 141 | +- label: Warning |
| 142 | + message: 💀 Spam |
| 143 | + color: '#f25265' |
| 144 | + when: $labels.includes('💀 Spam') |
145 | 145 |
|
0 commit comments