diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 091dea0b9..6d378bda8 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -69,10 +69,12 @@ jobs: const { owner, repo } = context.repo; const prNumber = process.env.PR_NUMBER; const environment = 'docs-preview'; + const task = prNumber ? `docs-preview-${prNumber}` : undefined; const deployment = await github.rest.repos.createDeployment({ owner, repo, environment, + task, ref: process.env.REF, auto_merge: false, transient_environment: true, diff --git a/.github/workflows/preview-cleanup.yml b/.github/workflows/preview-cleanup.yml index 14fb14616..eeed40496 100644 --- a/.github/workflows/preview-cleanup.yml +++ b/.github/workflows/preview-cleanup.yml @@ -24,7 +24,7 @@ jobs: owner, repo, environment: 'docs-preview', - ref: context.payload.pull_request.head.ref, + task: `docs-preview-${context.issue.number}`, }); core.setOutput('is-empty', deployments.data.length === 0) for (const deployment of deployments.data) {