The great refactor (#82)
This commit is contained in:
22
source/plugins/followup/README.md
Normal file
22
source/plugins/followup/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
### 🎟️ Follow-up of issues and pull requests
|
||||
|
||||
The *followup* plugin displays the ratio of open/closed issues and the ratio of open/merged pull requests across all your repositories, which shows if they're well-maintained or not.
|
||||
|
||||
<table>
|
||||
<td align="center">
|
||||
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.followup.svg">
|
||||
<img width="900" height="1" alt="">
|
||||
</td>
|
||||
</table>
|
||||
|
||||
#### ℹ️ Examples workflows
|
||||
|
||||
[➡️ Available options for this plugin](metadata.yml)
|
||||
|
||||
```yaml
|
||||
- uses: lowlighter/metrics@latest
|
||||
with:
|
||||
# ... other options
|
||||
plugin_followup: yes
|
||||
```
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
//Setup
|
||||
export default async function ({computed, q}, {enabled = false} = {}) {
|
||||
export default async function ({data, computed, imports, q, account}, {enabled = false} = {}) {
|
||||
//Plugin execution
|
||||
try {
|
||||
//Check if plugin is enabled and requirements are met
|
||||
if ((!enabled)||(!q.followup))
|
||||
return null
|
||||
|
||||
//Load inputs
|
||||
imports.metadata.plugins.followup.inputs({data, account, q})
|
||||
|
||||
//Define getters
|
||||
const followup = {
|
||||
issues:{
|
||||
@@ -18,6 +22,7 @@
|
||||
get merged() { return computed.repositories.pr_merged }
|
||||
}
|
||||
}
|
||||
|
||||
//Results
|
||||
return followup
|
||||
}
|
||||
|
||||
13
source/plugins/followup/metadata.yml
Normal file
13
source/plugins/followup/metadata.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
name: "🎟️ Follow-up of issues and pull requests"
|
||||
cost: 0 API request
|
||||
supports:
|
||||
- user
|
||||
- organization
|
||||
- repository
|
||||
inputs:
|
||||
|
||||
# Enable or disable plugin
|
||||
plugin_followup:
|
||||
description: Display follow-up of repositories issues and pull requests
|
||||
type: boolean
|
||||
default: no
|
||||
Reference in New Issue
Block a user