Skip to content

Commit 9bf3b18

Browse files
Allow finish step to update environment name (#146)
The API allows for updating the environment name when creating a status: https://docs.github.com/en/rest/deployments/statuses?apiVersion=2022-11-28#create-a-deployment-status
1 parent b206567 commit 9bf3b18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/steps/finish.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type FinishArgs = {
88
override: boolean;
99
status: string;
1010
envURL?: string;
11+
environment?: string;
1112
autoInactive: boolean;
1213
};
1314

@@ -18,7 +19,7 @@ async function createFinish(
1819
) {
1920
const {
2021
log,
21-
coreArgs: { description, logsURL },
22+
coreArgs: { description, logsURL, environment },
2223
} = context;
2324
if (stepArgs.override) {
2425
await deactivateEnvironment(github, context);
@@ -54,6 +55,7 @@ async function createFinish(
5455
state: newStatus,
5556
description: description,
5657
ref: context.ref,
58+
environment: environment,
5759

5860
// only set environment_url if deployment worked
5961
environment_url: newStatus === "success" ? stepArgs.envURL : "",

0 commit comments

Comments
 (0)