Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions packages/cli/src/get-github-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const getGifRef = (logLevel: LogLevel): string | null => {
}
};

const getFromEnvVariables = (): GitSource | null => {
const getFromEnvVariables = (remotionRoot: string): GitSource | null => {
const {
VERCEL_GIT_PROVIDER,
VERCEL_GIT_COMMIT_SHA,
Expand All @@ -125,12 +125,19 @@ const getFromEnvVariables = (): GitSource | null => {
VERCEL_GIT_REPO_SLUG &&
VERCEL_GIT_PROVIDER === 'github'
) {
let relativeFromGitRoot = '';
const gitConfig = getGitConfig(remotionRoot);
if (gitConfig) {
const gitRoot = path.dirname(path.dirname(gitConfig));
relativeFromGitRoot = path.relative(gitRoot, remotionRoot);
}

return {
name: VERCEL_GIT_REPO_SLUG,
org: VERCEL_GIT_REPO_OWNER,
ref: VERCEL_GIT_COMMIT_SHA,
type: 'github',
relativeFromGitRoot: '',
relativeFromGitRoot,
};
}

Expand All @@ -150,9 +157,9 @@ export const getGitSource = ({
return null;
}

const fromEnv = getFromEnvVariables();
const fromEnv = getFromEnvVariables(remotionRoot);
if (fromEnv) {
return getFromEnvVariables();
return fromEnv;
}

const ref = getGifRef(logLevel);
Expand Down
8 changes: 7 additions & 1 deletion packages/cli/src/test/get-github-repo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
expect(
origin?.url === 'https://github.com/remotion-dev/remotion.git' ||
origin?.url === 'https://github.com/remotion-dev/remotion',
).toEqual(true);

Check failure on line 18 in packages/cli/src/test/get-github-repo.test.ts

View workflow job for this annotation

GitHub Actions / Build Node 25 on macos-latest

error: expect(received).toEqual(expected)

Expected: true Received: false at <anonymous> (/Users/runner/work/lib-remotion/lib-remotion/packages/cli/src/test/get-github-repo.test.ts:18:4)

Check failure on line 18 in packages/cli/src/test/get-github-repo.test.ts

View workflow job for this annotation

GitHub Actions / Build Node 16 on ubuntu-latest

error: expect(received).toEqual(expected)

Expected: true Received: false at <anonymous> (/home/runner/work/lib-remotion/lib-remotion/packages/cli/src/test/get-github-repo.test.ts:18:4)

Check failure on line 18 in packages/cli/src/test/get-github-repo.test.ts

View workflow job for this annotation

GitHub Actions / Build Node 25 on macos-latest

error: expect(received).toEqual(expected)

Expected: true Received: false at <anonymous> (/Users/runner/work/lib-remotion/lib-remotion/packages/cli/src/test/get-github-repo.test.ts:18:4)

Check failure on line 18 in packages/cli/src/test/get-github-repo.test.ts

View workflow job for this annotation

GitHub Actions / Build Node 16 on ubuntu-latest

error: expect(received).toEqual(expected)

Expected: true Received: false at <anonymous> (/home/runner/work/lib-remotion/lib-remotion/packages/cli/src/test/get-github-repo.test.ts:18:4)
});

test('Should normalize SSH URLs', () => {
Expand Down Expand Up @@ -69,7 +69,7 @@
process.env.VERCEL_GIT_REPO_OWNER = 'remotion-dev';

const source = getGitSource({
remotionRoot: 'dontmatter',
remotionRoot: process.cwd(),
disableGitSource: false,
logLevel: 'info',
});
Expand All @@ -78,4 +78,10 @@
expect(source?.org).toBe('remotion-dev');
expect(source?.ref).toBe('123');
expect(source?.type).toBe('github');
expect(source?.relativeFromGitRoot).toBe(`packages${path.sep}cli`);

delete process.env.VERCEL_GIT_COMMIT_SHA;
delete process.env.VERCEL_GIT_PROVIDER;
delete process.env.VERCEL_GIT_REPO_SLUG;
delete process.env.VERCEL_GIT_REPO_OWNER;
});
2 changes: 1 addition & 1 deletion packages/player/src/PlayerUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ const PlayerUI: React.ForwardRefRenderFunction<

if (vol < 0 || vol > 1) {
throw new TypeError(
`setVolume() got a number that is out of range. Must be between 0 and 1, got ${typeof vol}`,
`setVolume() got a number that is out of range. Must be between 0 and 1, got ${vol}`,
);
}

Expand Down
Loading