From 27c8f224bd2708d40a646ffe8705fac53789f681 Mon Sep 17 00:00:00 2001 From: Thomas Kappler Date: Mon, 30 Jan 2023 07:14:13 -0800 Subject: [PATCH 1/5] Clone with submodules Necessary since pulumi/pulumi-aws#2247 --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e922738..f9ee3ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,9 +19,10 @@ jobs: go-version: 1.18.x check-latest: true - name: Check out source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ env.PR_COMMIT_SHA }} + submodules: true - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.7.1 with: From 31eecdf20e57615b9eff48f16195da26a1cb5164 Mon Sep 17 00:00:00 2001 From: Thomas Kappler Date: Tue, 31 Jan 2023 05:34:24 -0800 Subject: [PATCH 2/5] Revert "Clone with submodules" This reverts commit 27c8f224bd2708d40a646ffe8705fac53789f681. --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f9ee3ee..e922738 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,10 +19,9 @@ jobs: go-version: 1.18.x check-latest: true - name: Check out source code - uses: actions/checkout@v3 + uses: actions/checkout@v2 with: ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.7.1 with: From cd151d8e440b0e045f077a941e738db8df9dd221 Mon Sep 17 00:00:00 2001 From: Thomas Kappler Date: Tue, 31 Jan 2023 06:37:12 -0800 Subject: [PATCH 3/5] Clone submodules at the right place --- src/main.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index c7b4838..4507367 100644 --- a/src/main.ts +++ b/src/main.ts @@ -93,9 +93,8 @@ async function run() { cwd: downstreamModDirFull, }; - await exec("git", ["clone", "--quiet", downstreamRepo, downstreamDir]); + await exec("git", ["clone", "--quiet", "--branch", branchName, "--recurse-submodules", downstreamRepo, downstreamDir]); - await exec("git", ["checkout", "-b", branchName], inDownstreamOptions); await exec("git", ["config", "user.name", gitUser], inDownstreamOptions); await exec("git", ["config", "user.email", gitEmail], inDownstreamOptions); From 263ecd1b89cad5d25b4e67e64fad5936fd6bf19e Mon Sep 17 00:00:00 2001 From: Thomas Kappler Date: Tue, 31 Jan 2023 06:55:14 -0800 Subject: [PATCH 4/5] Clone submodules at the right place, compiled --- lib/main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index 6e200ad..f4f5e15 100644 --- a/lib/main.js +++ b/lib/main.js @@ -103,8 +103,7 @@ function run() { env: Object.assign(Object.assign({}, process.env), { PATH: newPath }), }; const inDownstreamModOptions = Object.assign(Object.assign({}, inDownstreamOptions), { cwd: downstreamModDirFull }); - yield (0, exec_1.exec)("git", ["clone", "--quiet", downstreamRepo, downstreamDir]); - yield (0, exec_1.exec)("git", ["checkout", "-b", branchName], inDownstreamOptions); + yield (0, exec_1.exec)("git", ["clone", "--quiet", "--branch", branchName, "--recurse-submodules", downstreamRepo, downstreamDir]); yield (0, exec_1.exec)("git", ["config", "user.name", gitUser], inDownstreamOptions); yield (0, exec_1.exec)("git", ["config", "user.email", gitEmail], inDownstreamOptions); for (const replace of replacements) { From d1d7719fb7f23ce32471309c1210f104466d2441 Mon Sep 17 00:00:00 2001 From: Thomas Kappler Date: Tue, 31 Jan 2023 07:15:22 -0800 Subject: [PATCH 5/5] Check out submodules at the right place --- lib/main.js | 4 +++- src/main.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index f4f5e15..25692da 100644 --- a/lib/main.js +++ b/lib/main.js @@ -103,7 +103,9 @@ function run() { env: Object.assign(Object.assign({}, process.env), { PATH: newPath }), }; const inDownstreamModOptions = Object.assign(Object.assign({}, inDownstreamOptions), { cwd: downstreamModDirFull }); - yield (0, exec_1.exec)("git", ["clone", "--quiet", "--branch", branchName, "--recurse-submodules", downstreamRepo, downstreamDir]); + yield (0, exec_1.exec)("git", ["clone", "--quiet", downstreamRepo, downstreamDir]); + yield (0, exec_1.exec)("git", ["checkout", "-b", branchName], inDownstreamOptions); + yield (0, exec_1.exec)("git", ["submodule", "update", "--init"], inDownstreamOptions); yield (0, exec_1.exec)("git", ["config", "user.name", gitUser], inDownstreamOptions); yield (0, exec_1.exec)("git", ["config", "user.email", gitEmail], inDownstreamOptions); for (const replace of replacements) { diff --git a/src/main.ts b/src/main.ts index 4507367..1507019 100644 --- a/src/main.ts +++ b/src/main.ts @@ -93,7 +93,10 @@ async function run() { cwd: downstreamModDirFull, }; - await exec("git", ["clone", "--quiet", "--branch", branchName, "--recurse-submodules", downstreamRepo, downstreamDir]); + await exec("git", ["clone", "--quiet", downstreamRepo, downstreamDir]); + + await exec("git", ["checkout", "-b", branchName], inDownstreamOptions); + await exec("git", ["submodule", "update", "--init"], inDownstreamOptions); await exec("git", ["config", "user.name", gitUser], inDownstreamOptions); await exec("git", ["config", "user.email", gitEmail], inDownstreamOptions);