This commit is contained in:
lowlighter
2022-01-21 20:39:51 -05:00
7 changed files with 146 additions and 0 deletions

View File

@@ -53,6 +53,38 @@ Content can be manually ordered using `config_order` option.
> 💡 Omitted sections will be appended at the end using default order
## 🪛 Using presets
> 🚧 This feature is an early implementation and may change before official release
It is possible to reuse the same configuration across different repositories and workflows using configuration presets.
A preset override the default values of inputs, and multiple presets can be provided at once through URLs or file paths.
Options resolution is done in the following order:
- default values
- presets, from first to last
- user values
*Example: using a configuration preset from an url*
```yaml
- uses: lowlighter/metrics@latest
with:
config_presets: https://raw.githubusercontent.com/lowlighter/metrics/presets/lunar-red/preset.yaml
```
Some presets are hosted on this repository on the [`@presets`](https://github.com/lowlighter/metrics/tree/presets) branch and can be used directly by using using their identifier prefixed by an arobase (`@`).
*Example: using a pre-defined configuration preset*
```yaml
- uses: lowlighter/metrics@latest
with:
config_presets: "@lunar-red"
```
> ⚠️ `🔐 Tokens` and options marked with `⏯️ Cannot be preset`, as they suggest, cannot be preset and thus requires to be explicitely defined to be set.
> Presets configurations use [schemas](https://github.com/lowlighter/metrics/tree/presets/%40schema) to ensure compatibility between format changes
## 🎨 Custom CSS styling
Additional CSS can be injected using `extras_css` option.

View File

@@ -29,6 +29,19 @@
token: ${{ secrets.METRICS_TOKEN }}
config_output: png
- name: Presets
uses: lowlighter/metrics@latest
with:
filename: metrics.presets.svg
token: ${{ secrets.METRICS_TOKEN }}
base: header, repositories
config_presets: https://raw.githubusercontent.com/lowlighter/metrics/presets/lunar-red/preset.yaml
prod:
skip: true
test:
modes:
- web
- name: Plugin error example
uses: lowlighter/metrics@latest
with:

View File

@@ -25,6 +25,7 @@ inputs:
Defaults to `token` owner username.
type: string
default: ""
preset: no
repo:
description: |
@@ -33,6 +34,7 @@ inputs:
This option is revevalant only for repositories templates
type: string
default: ""
preset: no
committer_token:
description: |
@@ -67,6 +69,7 @@ inputs:
Specify an existing gist id (can be retrieved from its URL) when using `output_action: gist`.
type: string
default: ""
preset: no
filename:
description: |
@@ -307,6 +310,14 @@ inputs:
- markdown-pdf
- insights
config_presets:
description: Configuration presets
type: array
format: comma-separated
default: ""
preset: no
example: "@lunar-red"
retries:
description: Retries in case of failures (for rendering)
type: number
@@ -357,6 +368,7 @@ inputs:
type: boolean
default: yes
testing: yes
preset: no
plugins_errors_fatal:
description: |
@@ -366,6 +378,7 @@ inputs:
type: boolean
default: no
testing: yes
preset: no
debug:
description: |
@@ -375,12 +388,14 @@ inputs:
type: boolean
default: no
testing: yes
preset: no
verify:
description: SVG validity check
type: boolean
default: no
testing: yes
preset: no
debug_flags:
description: |
@@ -398,6 +413,7 @@ inputs:
- --halloween
- --error
testing: yes
preset: no
dryrun:
description: |
@@ -407,6 +423,7 @@ inputs:
type: boolean
default: no
testing: yes
preset: no
experimental_features:
description: |
@@ -419,9 +436,11 @@ inputs:
values:
- --optimize-svg
testing: yes
preset: no
use_mocked_data:
description: Use mocked data instead of live APIs
type: boolean
default: no
testing: yes
preset: no