Skip to content

Commit

Permalink
feat(script): skip repositories named '.github' (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
oscard0m authored Sep 8, 2022
1 parent 8cc2ace commit 579de25
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ export async function script(octokit, repository, options) {
return;
}

if (repository.name === ".github") {
octokit.log.info(
{ owner, repo, updated: false },
`${repository.name} is a blacklisted repository name. No changed applied.`
);
return;
}

let currentExtends;

const {
Expand Down
18 changes: 18 additions & 0 deletions script.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,24 @@ test("returns if repository is archived", async () => {
equal(nock.pendingMocks().length, 0);
});

test("returns if repository is named '.github'", async () => {
const dotGithubRepo = {
...repository,
name: ".github",
full_name: "octocat/.github",
};

try {
await script(getOctokitForTests(), dotGithubRepo, {
extends: "github>octoherd/.github",
});
} catch (error) {
unreachable("should have NOT thrown");
}

equal(nock.pendingMocks().length, 0);
});

test("creates JSON file if file does NOT exist in the repository", async () => {
const path = "renovate.json";

Expand Down

0 comments on commit 579de25

Please sign in to comment.