Skip to content

Commit a3998f3

Browse files
committed
fix(buildkite): Extract slug from git URL
1 parent 8d02b70 commit a3998f3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

services/buildkite.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// https://buildkite.com/docs/builds/environment-variables
2+
import { getSlugFromGitURL } from "../lib/git.js";
23

34
export default {
45
detect({ env }) {
@@ -21,7 +22,7 @@ export default {
2122
branch: isPr
2223
? env.BUILDKITE_PULL_REQUEST_BASE_BRANCH
2324
: env.BUILDKITE_BRANCH,
24-
slug: `${env.BUILDKITE_ORGANIZATION_SLUG}/${env.BUILDKITE_PROJECT_SLUG}`,
25+
slug: getSlugFromGitURL(env.BUILDKITE_REPO),
2526
pr,
2627
isPr,
2728
prBranch: isPr ? env.BUILDKITE_BRANCH : undefined,

test/services/buildkite.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ const env = {
1010
BUILDKITE_BRANCH: "master",
1111
BUILDKITE_PULL_REQUEST: "false",
1212
BUILDKITE_BUILD_CHECKOUT_PATH: "/",
13-
BUILDKITE_ORGANIZATION_SLUG: "owner",
14-
BUILDKITE_PROJECT_SLUG: "repo",
13+
BUILDKITE_REPO: "git@github.com:owner/repo.git",
1514
};
1615

1716
test("Push", (t) => {

0 commit comments

Comments
 (0)