Skip to content

Commit 9db2be7

Browse files
committed
Add support for providing custom hash to the cursor deploy
1 parent b1fee0d commit 9db2be7

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

actions/cursor-deploy/action.yml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ inputs:
1313
description: The deployment mode (default / rollback / unblock)
1414
required: false
1515
default: 'default'
16+
custom_hash:
17+
required: false
18+
description: 'Custom hash of the deployment'
1619
outputs:
1720
tree_hash:
1821
description: The tree hash of the performed deployment

actions/cursor-deploy/dist/main/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -24324,12 +24324,14 @@ runAction(async () => {
2432424324
async function cursorDeploy({
2432524325
ref,
2432624326
bucket,
24327+
// NOTE: Using custom hash for deployment doesn't work will the rollback/unblock workflows
24328+
customHash,
2432724329
deployModeInput,
2432824330
rollbackCommitHash
2432924331
}) {
2433024332
const deployMode = getDeployMode(deployModeInput);
2433124333
const branchLabel = branchNameToHostnameLabel(ref);
24332-
const treeHash = await getDeploymentHash(deployMode, rollbackCommitHash);
24334+
const treeHash = customHash ?? await getDeploymentHash(deployMode, rollbackCommitHash);
2433324335
const rollbackKey = `rollbacks/${branchLabel}`;
2433424336
const deployKey = `deploys/${branchLabel}`;
2433524337
if (deployMode === "default" || deployMode === "unblock") {

actions/cursor-deploy/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,22 @@ runAction(async () => {
4242
interface CursorDeployActionArgs {
4343
bucket: string
4444
deployModeInput: string
45+
customHash?: string
4546
rollbackCommitHash: string
4647
ref: string
4748
}
4849

4950
export async function cursorDeploy({
5051
ref,
5152
bucket,
53+
// NOTE: Using custom hash for deployment doesn't work will the rollback/unblock workflows
54+
customHash,
5255
deployModeInput,
5356
rollbackCommitHash
5457
}: CursorDeployActionArgs) {
5558
const deployMode = getDeployMode(deployModeInput)
5659
const branchLabel = branchNameToHostnameLabel(ref)
57-
const treeHash = await getDeploymentHash(deployMode, rollbackCommitHash)
60+
const treeHash = customHash ?? (await getDeploymentHash(deployMode, rollbackCommitHash))
5861

5962
const rollbackKey = `rollbacks/${branchLabel}`
6063
const deployKey = `deploys/${branchLabel}`

0 commit comments

Comments
 (0)