Add quickstart commands

This commit is contained in:
lowlighter
2021-02-04 22:46:47 +01:00
parent 96d59e94c1
commit 5eaf603357
10 changed files with 154 additions and 3 deletions

19
.github/quickstart/plugin/README.md vendored Normal file
View File

@@ -0,0 +1,19 @@
### 🧩 <%= `${name.charAt(0).toLocaleUpperCase()}${name.substring(1)}` %>
<table>
<td align="center">
<img src="">
<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_<%= name %>: yes
```

15
.github/quickstart/plugin/index.mjs vendored Normal file
View File

@@ -0,0 +1,15 @@
//Setup
export default async function ({login, q, imports, data, computed, rest, graphql, queries, account}, {enabled = false} = {}) {
//Plugin execution
try {
//Check if plugin is enabled and requirements are met
if ((!enabled)||(!q.<%= name %>))
return null
//Results
return {}
}
//Handle errors
catch (error) {
throw {error:{message:"An error occured", instance:error}}
}
}

19
.github/quickstart/plugin/metadata.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: "🧩 <%= `${name.charAt(0).toLocaleUpperCase()}${name.substring(1)}` %>"
# Estimate of how many GitHub requests will be used
cost: N/A
# Supported modes
supports:
- user
- organization
- repository
# Inputs list
inputs:
# Enable or disable plugin
plugin_<%= name %>:
description: description
type: boolean
default: no

5
.github/quickstart/plugin/tests.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
- name: <%= `${name.charAt(0).toLocaleUpperCase()}${name.substring(1)}` %> plugin (default)
uses: lowlighter/metrics@latest
with:
token: MOCKED_TOKEN
plugin_<%= name %>: yes