Skip to content

Commit 579de25

Browse files
authored
feat(script): skip repositories named '.github' (#35)
1 parent 8cc2ace commit 579de25

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

script.js

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ export async function script(octokit, repository, options) {
2828
return;
2929
}
3030

31+
if (repository.name === ".github") {
32+
octokit.log.info(
33+
{ owner, repo, updated: false },
34+
`${repository.name} is a blacklisted repository name. No changed applied.`
35+
);
36+
return;
37+
}
38+
3139
let currentExtends;
3240

3341
const {

script.test.js

+18
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,24 @@ test("returns if repository is archived", async () => {
438438
equal(nock.pendingMocks().length, 0);
439439
});
440440

441+
test("returns if repository is named '.github'", async () => {
442+
const dotGithubRepo = {
443+
...repository,
444+
name: ".github",
445+
full_name: "octocat/.github",
446+
};
447+
448+
try {
449+
await script(getOctokitForTests(), dotGithubRepo, {
450+
extends: "github>octoherd/.github",
451+
});
452+
} catch (error) {
453+
unreachable("should have NOT thrown");
454+
}
455+
456+
equal(nock.pendingMocks().length, 0);
457+
});
458+
441459
test("creates JSON file if file does NOT exist in the repository", async () => {
442460
const path = "renovate.json";
443461

0 commit comments

Comments
 (0)