Skip to content

Commit

Permalink
feat(script): scaffold renovate config for octoherd repos (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
oscard0m authored Sep 8, 2022
1 parent 717b4d9 commit e9a7a1a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import createPullRequest from "./lib/create-pull-request.js";
import createReadme from "./lib/create-readme.js";
import createReleaseAction from "./lib/create-release-action.js";
import createTestAction from "./lib/create-test-action.js";
import createRenovateConfig from "./lib/create-renovate-config.js";
import createRepository from "./lib/create-repository.js";
import createScript from "./lib/create-script.js";
import prompts from "./lib/prompts.js";
Expand Down Expand Up @@ -245,6 +246,12 @@ run(script);
await command(`git add .github/workflows/test.yml`);
await command(`git commit -m 'ci(test): initial version'`);

if (owner === "octoherd") {
await createRenovateConfig();
await command(`git add .github/renovate.json`);
await command(`git commit -m 'build(renovate): create renovate setup'`);
}

await command(`git push`);

console.log(`Your new repository is here:
Expand Down
9 changes: 9 additions & 0 deletions lib/create-renovate-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import writePrettyFile from "./write-pretty-file.js";
import getTemplateFileContent from "./get-template-file-content.js";

export default async function createRenovateConfig() {
const renovateFileName = "renovate.json";
let fileContent = getTemplateFileContent(renovateFileName);

await writePrettyFile(`.github/${renovateFileName}`, fileContent);
}
3 changes: 3 additions & 0 deletions templates/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["github>octoherd/.github"]
}

0 comments on commit e9a7a1a

Please sign in to comment.