Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lswith/probot-config-manager
A configuration Manager for Probot
https://github.com/lswith/probot-config-manager
Last synced: 3 days ago
JSON representation
A configuration Manager for Probot
- Host: GitHub
- URL: https://github.com/lswith/probot-config-manager
- Owner: lswith
- License: apache-2.0
- Created: 2019-07-26T06:01:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T19:34:01.000Z (almost 2 years ago)
- Last Synced: 2024-12-15T14:38:00.740Z (8 days ago)
- Language: TypeScript
- Size: 3.07 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Config Manager
[![Downloads][npm-downloads]][npm-url] [![version][npm-version]][npm-url]
[![Build Status][travis-status]][travis-url]A [Probot](https://probot.github.io) plugin to manage configuration files effectively.
Configuration files are validated by Joi and cached appropriately.## Example
```typescript
# models
import Joi = require("joi");export interface IComment {
comment: string;
label: string;
}export interface IConfig {
comments?: IComment[];
}//
// comments:
// - label: needs-area
// comment: |
// There is no area label added to this issue/PR.
// Please add an area: label
export const schema = Joi.object().keys({
comments: Joi.array().items(
Joi.object().keys({
comment: Joi.string(),
label: Joi.string()
})
)
});
``````typescript
import { IConfig, schema } from "./models";
const configManager = new ConfigManager("comment.yml", {}, schema);
app.on(events, async (context: Context) => {
const config = await configManager.getConfig(context).catch(err => {
context.log.error(err);
return {} as IConfig;
});
});
```## Contribute
If you have suggestions for how this bot could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
[travis-status]: https://travis-ci.org/lswith/probot-config-manager.svg?branch=master
[travis-url]: https://travis-ci.org/lswith/probot-config-manager
[npm-downloads]: https://img.shields.io/npm/dm/probot-config-manager.svg?style=flat
[npm-version]: https://img.shields.io/npm/v/probot-config-manager.svg?style=flat
[npm-url]: https://www.npmjs.com/package/probot-config-manager