Skip to content

Commit 5565a61

Browse files
authored
Continuous delivery take II (#509)
1 parent bfd4097 commit 5565a61

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/deploy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
environment: production
1414
steps:
1515
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
1618
- uses: actions/setup-node@v1
1719
with:
1820
node-version: 16

src/scripts/prepareForExtensionPublish.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ async function main() {
2525
// See https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
2626
const repository = process.env["GITHUB_REPOSITORY"];
2727
const runId = process.env["GITHUB_RUN_ID"];
28+
const githubBaseUrl = process.env["GITHUB_SERVER_URL"];
2829

2930
if (repository == null) {
3031
throw new Error("Missing environment variable GITHUB_REPOSITORY");
@@ -34,11 +35,15 @@ async function main() {
3435
throw new Error("Missing environment variable GITHUB_RUN_ID");
3536
}
3637

38+
if (githubBaseUrl == null) {
39+
throw new Error("Missing environment variable GITHUB_SERVER_URL");
40+
}
41+
3742
await writeFile(
3843
"build-info.json",
3944
JSON.stringify({
4045
gitSha: (await runCommand("git rev-parse HEAD")).trim(),
41-
buildUrl: `https://github.com/${repository}/actions/runs/${runId}`,
46+
buildUrl: `${githubBaseUrl}/${repository}/actions/runs/${runId}`,
4247
})
4348
);
4449
}

0 commit comments

Comments
 (0)