Unverified Commit 13e83e14 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[ci] Add support for private preview builds (#93375)

parent a35edcfb
......@@ -67,4 +67,5 @@ jobs:
github.event.workflow_run.head_sha }}" "${{ runner.temp
}}/preview-tarballs"
env:
BLOB_ACCESS: ${{ vars.PREVIEW_BUILDS_ACCESS }}
BLOB_READ_WRITE_TOKEN: ${{ secrets.PREVIEW_BUILDS_BLOB_READ_WRITE_TOKEN }}
......@@ -58,6 +58,12 @@ async function main() {
if (!process.env.BLOB_READ_WRITE_TOKEN) {
throw new Error('BLOB_READ_WRITE_TOKEN environment variable is required')
}
const blobAccess = process.env.BLOB_ACCESS
if (blobAccess !== 'private' && blobAccess !== 'public') {
throw new Error(
`BLOB_ACCESS environment variable can only be "private" or "public" but got "${blobAccess}".`
)
}
for await (const { packageName, tarballPath } of findTarballs(
tarballDirectory
......@@ -66,7 +72,7 @@ async function main() {
const fileBuffer = await fs.readFile(tarballPath)
const { url } = await put(blobPathname, fileBuffer, {
access: 'public',
access: blobAccess,
addRandomSuffix: false,
contentType: 'application/gzip',
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment