Notary Public Mystifier

    probot-config-manager
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.0 • Public • Published

    Config Manager

    Downloads version Build Status

    A Probot plugin to manage configuration files effectively. Configuration files are validated by Joi and cached appropriately.

    Example

    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:<team> label
    export const schema = Joi.object().keys({
      comments: Joi.array().items(
        Joi.object().keys({
          comment: Joi.string(),
          label: Joi.string()
        })
      )
    });
    import { IConfig, schema } from "./models";
    const configManager = new ConfigManager<IConfig>("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.

    Keywords

    Install

    npm i probot-config-manager

    DownloadsWeekly Downloads

    2

    Version

    1.2.0

    License

    Apache-2.0

    Unpacked Size

    30.1 kB

    Total Files

    15

    Last publish

    Collaborators

    • lswith