Files
metrics/source/plugins/code/README.md

49 lines
1.8 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
### ♐ Code snippet of the day
> ⚠️ When improperly configured, this plugin could display private code. If you work with sensitive data or company code, it is advised to keep this plugin disabled. *Metrics* and its authors cannot be held responsible for any resulting code leaks, use at your own risk.
Display a random code snippet from your recent activity history.
<table>
<td align="center">
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.code.svg">
<img width="900" height="1" alt="">
</td>
</table>
#### ➡️ Available options
<!--options-->
| Option | Type *(format)* **[default]** *{allowed values}* | Description |
| ------ | -------------------------------- | ----------- |
| `plugin_code` | `boolean` **[no]** | Display a random code snippet from recent activity |
| `plugin_code_lines` | `number` **[12]** | Maximum number of line that a code snippet can contain |
| `plugin_code_load` | `number` **[100]** *{100 ≤ 𝑥 ≤ 1000}* | Number of events to load |
| `plugin_code_visibility` | `string` **[public]** *{"public", "all"}* | Set events visibility |
| `plugin_code_skipped` | `array` *(comma-separated)* **[]** | Repositories to skip |
| `plugin_code_languages` | `array` *(comma-separated)* **[]** | Restrict code snippet languages |
Legend for option icons:
* 🔐 Value should be stored in repository secrets
* ✨ New feature currently in testing on `master`/`main`
<!--/options-->
*[→ Full specification](metadata.yml)*
#### Examples workflows
<!--examples-->
```yaml
name: JavaScript or TypeScript snippet of the day
uses: lowlighter/metrics@latest
with:
filename: metrics.plugin.code.svg
token: ${{ secrets.METRICS_TOKEN }}
base: ''
plugin_code: 'yes'
plugin_code_languages: javascript, typescript
plugin_code_load: 400
```
<!--/examples-->