Skip to content

Commit 13e83e1

Browse files
authored
[ci] Add support for private preview builds (#93375)
1 parent a35edcf commit 13e83e1

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/upload_preview_tarballs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@ jobs:
6767
github.event.workflow_run.head_sha }}" "${{ runner.temp
6868
}}/preview-tarballs"
6969
env:
70+
BLOB_ACCESS: ${{ vars.PREVIEW_BUILDS_ACCESS }}
7071
BLOB_READ_WRITE_TOKEN: ${{ secrets.PREVIEW_BUILDS_BLOB_READ_WRITE_TOKEN }}

scripts/upload-preview-tarballs.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ async function main() {
5858
if (!process.env.BLOB_READ_WRITE_TOKEN) {
5959
throw new Error('BLOB_READ_WRITE_TOKEN environment variable is required')
6060
}
61+
const blobAccess = process.env.BLOB_ACCESS
62+
if (blobAccess !== 'private' && blobAccess !== 'public') {
63+
throw new Error(
64+
`BLOB_ACCESS environment variable can only be "private" or "public" but got "${blobAccess}".`
65+
)
66+
}
6167

6268
for await (const { packageName, tarballPath } of findTarballs(
6369
tarballDirectory
@@ -66,7 +72,7 @@ async function main() {
6672

6773
const fileBuffer = await fs.readFile(tarballPath)
6874
const { url } = await put(blobPathname, fileBuffer, {
69-
access: 'public',
75+
access: blobAccess,
7076
addRandomSuffix: false,
7177
contentType: 'application/gzip',
7278
})

0 commit comments

Comments
 (0)