Skip to content

Commit

Permalink
fix(scripts): git fetch origin provided commit in codegen (#5159)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Aug 31, 2023
1 parent fa8ecad commit 9b6655a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion scripts/generate-clients/build-smithy-typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ const buildSmithyTypeScript = async (repo, commit) => {
await access(repo);
} catch (error) {
deleteSmithyTsRepo = true;
await spawnProcess("git", ["clone", "https://github.com/awslabs/smithy-typescript.git", repo]);
await spawnProcess("git", ["clone", "https://github.com/awslabs/smithy-typescript.git", repo, "--depth=1"]);
}

// Checkout commit
await spawnProcess("git", ["fetch", "origin", commit, "--depth=1"], { cwd: repo });

// Switch to branch with commit
const tempBranchName = `temp-${commit}`;
await spawnProcess("git", ["checkout", "-b", tempBranchName, commit], { cwd: repo });

Expand Down
3 changes: 2 additions & 1 deletion scripts/generate-clients/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Update this commit when taking up new changes from smithy-typescript.
module.exports = {
SMITHY_TS_COMMIT: "d942a87",
// Use full commit hash as we explcitly fetch it.
SMITHY_TS_COMMIT: "d942a87081c0ca101f77b2336042773b26b0b9b1",
};

0 comments on commit 9b6655a

Please sign in to comment.