Skip to content

Commit cf16ea2

Browse files
authored
chore: enable 'HMAC-SHA256' signatures on turborepo artifacts (#6526)
1 parent 9c3edfc commit cf16ea2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

scripts/turbo/index.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const { spawnProcess } = require("../utils/spawn-process");
33
const path = require("path");
44

5-
const runTurbo = async (task, args, apiSecret, apiEndpoint) => {
5+
const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey } = {}) => {
66
const command = ["turbo", "run", task, "--concurrency=100%", "--output-logs=hash-only"];
77
command.push(...args);
88
const turboRoot = path.join(__dirname, "..", "..");
@@ -14,8 +14,10 @@ const runTurbo = async (task, args, apiSecret, apiEndpoint) => {
1414
...process.env,
1515
TURBO_TELEMETRY_DISABLED: "1",
1616
...(apiSecret &&
17-
apiEndpoint && {
17+
apiEndpoint &&
18+
apiSignatureKey && {
1819
TURBO_API: apiEndpoint,
20+
TURBO_REMOTE_CACHE_SIGNATURE_KEY: apiSignatureKey,
1921
TURBO_TOKEN: apiSecret,
2022
TURBO_TEAM: "aws-sdk-js",
2123
}),
@@ -36,13 +38,14 @@ const runTurbo = async (task, args, apiSecret, apiEndpoint) => {
3638
const main = async () => {
3739
const apiSecret = process.env.AWS_JSV3_TURBO_CACHE_API_SECRET;
3840
const apiEndpoint = process.env.AWS_JSV3_TURBO_CACHE_API_ENDPOINT;
41+
const apiSignatureKey = process.env.AWS_JSV3_TURBO_CACHE_API_SIGNATURE_KEY;
3942

4043
const args = process.argv.slice(2);
4144

42-
if (!apiSecret || !apiEndpoint) {
45+
if (!apiSecret || !apiEndpoint || !apiSignatureKey) {
4346
await runTurbo(args[0], args.slice(1));
4447
} else {
45-
await runTurbo(args[0], args.slice(1), apiSecret, apiEndpoint);
48+
await runTurbo(args[0], args.slice(1), { apiSecret, apiEndpoint, apiSignatureKey });
4649
}
4750
};
4851

turbo.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "https://turbo.build/schema.json",
3-
"remoteCache": {},
3+
"remoteCache": {
4+
"signature": true
5+
},
46
"tasks": {
57
"build": {
68
"outputs": ["dist-types/**", "dist-cjs/**", "dist-es/**"],

0 commit comments

Comments
 (0)