Skip to content

Commit d44dbff

Browse files
committed
fix env variable name for diff commit
1 parent 1e4fa82 commit d44dbff

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/ci.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ beforeEach(() => {
1919
});
2020

2121
describe("guessBranch", () => {
22-
it("ensure the branch is guessed if ESLINT_PLUGIN_COMMIT is not already set", async () => {
23-
delete process.env.ESLINT_PLUGIN_COMMIT;
22+
it("ensure the branch is guessed if ESLINT_PLUGIN_DIFF_COMMIT is not already set", async () => {
23+
delete process.env.ESLINT_PLUGIN_DIFF_COMMIT;
2424
const { guessBranch } = await import("./ci");
25-
expect(() => guessBranch()).not.toThrowError(/ESLINT_PLUGIN_COMMIT/u);
25+
expect(() => guessBranch()).not.toThrowError(/ESLINT_PLUGIN_DIFF_COMMIT/u);
2626
});
2727

28-
it("ensure the branch is not guessed if ESLINT_PLUGIN_COMMIT is already set", async () => {
29-
process.env.ESLINT_PLUGIN_COMMIT = "origin/main";
28+
it("ensure the branch is not guessed if ESLINT_PLUGIN_DIFF_COMMIT is already set", async () => {
29+
process.env.ESLINT_PLUGIN_DIFF_COMMIT = "origin/main";
3030
const { guessBranch } = await import("./ci");
31-
expect(() => guessBranch()).toThrowError(/ESLINT_PLUGIN_COMMIT/u);
31+
expect(() => guessBranch()).toThrowError(/ESLINT_PLUGIN_DIFF_COMMIT/u);
3232
});
3333

3434
it("fails when too many providers were found as candidates", async () => {

src/ci.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ const guessProviders = () =>
9292
);
9393

9494
const guessBranch = (): string | undefined => {
95-
if ((process.env.ESLINT_PLUGIN_COMMIT ?? "").length > 0) {
96-
throw Error("ESLINT_PLUGIN_COMMIT already set");
95+
if ((process.env.ESLINT_PLUGIN_DIFF_COMMIT ?? "").length > 0) {
96+
throw Error("ESLINT_PLUGIN_DIFF_COMMIT already set");
9797
}
9898

9999
const guessedProviders = guessProviders();
@@ -103,7 +103,7 @@ const guessBranch = (): string | undefined => {
103103
.map(({ name }) => name)
104104
.join(
105105
", "
106-
)}). Please specify your target branch explicitly instead, e.g. ESLINT_PLUGIN_COMMIT="main"`
106+
)}). Please specify your target branch explicitly instead, e.g. ESLINT_PLUGIN_DIFF_COMMIT="main"`
107107
);
108108
}
109109

0 commit comments

Comments
 (0)