0.0.2 • Published 3 years ago
renovate-inspector v0.0.2
renovate-inspector
A small script meant to run alongside RenovateBot to inspect & report the amount of open RenovateBot MRs in Gitlab.
How To Use
- Install
renovate-inspector
yarn add renovate-inspector
# or
npm install renovate-inspectorEnsure you have a proper RenovateBot environment.
- Be sure you have
RENOVATE_CONFIG_FILEavailable in your env. - Be sure you have
RENOVATE_TOKENavailable in your env.
- Be sure you have
If you wish to do so, set up any optional environment variables.
- In order to send Slack messages, set your Slack Webhook URL with
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/<my slack webhook url path>". This defaults toundefinedand will send no Slack messages. - Set your target MR label with
RENOVATE_INSPECTOR_LABEL="<my renovatebot label>". This defaults to "RenovateBot". - Set your RenovateBot open MR limit with
RENOVATE_INSPECTOR_MR_LIMIT="<number of open mrs allowed>". This defaults to10. - Set an additional message to be included at the end of Slack messages with
RENOVATE_INSPECTOR_ADDITIONAL_MESSAGE="<additional message>". This defaults toundefinedand will display no additional message. This requiresSLACK_WEBHOOK_URLto be set.
- In order to send Slack messages, set your Slack Webhook URL with
Wherever you run
./node_modules/.bin/renovate, run./node_modules/.bin/renovate-inspectorbefore it.Update your
renovate.config.jsto be compatible withrenovate-inspector:
// renovate.config.js
let reposToBeSkipped = [];
try {
const renovateInspectorResults = require("renovate-inspector/lib/results.json");
reposToBeSkipped = renovateInspectorResults.reposToBeSkipped;
} catch (error) {
// Do nothing. It's ok if renovate-inspector results are not present.
// This will happen when renovate-inspector is running and using this file.
}
const repos = [
{ repo: "my-user/my-repo-1", channel: "@my-slack-username" },
{ repo: "my-user/my-repo-2", channel: "#my-slack-channel" },
].filter((x) => !reposToBeSkipped.includes(x.repo));
const repositories = repos.map((x) => x.repo);
module.exports = {
...
platform: "gitlab",
repos,
repositories,
};Contributing
Repo: https://gitlab.com/blackarctic/renovate-inspector
Be sure to run yarn run check to ensure proper formatting and linting.
Authors
Created by Nick Galloway