Skip to content

Commit f940b70

Browse files
feat: ✨ added new DEPLOYMENT_NAME input param for the action
1 parent 08959b2 commit f940b70

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

.changeset/selfish-socks-sing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler-action": minor
3+
---
4+
5+
Added the new DEPLOYMENT_NAME input param for the action. This param is responsible for the custom name of the GitHub Deployment

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ jobs:
186186
command: pages deploy YOUR_DIST_FOLDER --project-name=example
187187
# Optional: Enable this if you want to have GitHub Deployments triggered
188188
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
189+
# Optional: Add a custom deployment name for GitHub Deployments
190+
deploymentName: Example Project
189191
```
190192

191193
### Deploying on a schedule

src/commandOutputParsing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function handleVersionsOutputCommand(config: WranglerActionConfig) {
125125
);
126126
}
127127

128-
function handleDeprectatedStdoutParsing(
128+
function handleDeprecatedStdoutParsing(
129129
config: WranglerActionConfig,
130130
command: string,
131131
stdOut: string,
@@ -162,7 +162,7 @@ export async function handleCommandOutputParsing(
162162

163163
if (outputEntry === null) {
164164
// if no outputEntry found, fallback to deprecated stdOut parsing
165-
handleDeprectatedStdoutParsing(config, command, stdOut);
165+
handleDeprecatedStdoutParsing(config, command, stdOut);
166166
return;
167167
}
168168

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ const config: WranglerActionConfig = {
2626
tmpdir(),
2727
`wranglerArtifacts-${crypto.randomUUID()}`,
2828
)}`,
29-
GITHUB_TOKEN: getInput("gitHubToken", { required: false }),
29+
GITHUB_TOKEN: getInput("gitHubToken"),
30+
DEPLOYMENT_NAME: getInput("deploymentName"),
3031
} as const;
3132

3233
const packageManager = getPackageManager(config.PACKAGE_MANAGER, {

src/service/github.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,15 @@ export async function createGitHubDeploymentAndJobSummary(
9595
pagesArtifactFields.deployment_trigger
9696
) {
9797
const octokit = getOctokit(config.GITHUB_TOKEN);
98+
const environment = config.DEPLOYMENT_NAME || pagesArtifactFields.environment;
9899
const [createGitHubDeploymentRes, createJobSummaryRes] =
99100
await Promise.allSettled([
100101
createGitHubDeployment({
101102
config,
102103
octokit,
104+
environment,
103105
deploymentUrl: pagesArtifactFields.url,
104106
productionBranch: pagesArtifactFields.production_branch,
105-
environment: pagesArtifactFields.environment,
106107
deploymentId: pagesArtifactFields.deployment_id,
107108
projectName: pagesArtifactFields.pages_project,
108109
}),

src/wranglerAction.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const wranglerActionConfig = z.object({
2929
PACKAGE_MANAGER: z.string(),
3030
WRANGLER_OUTPUT_DIR: z.string(),
3131
GITHUB_TOKEN: z.string(),
32+
DEPLOYMENT_NAME: z.string().optional(),
3233
});
3334

3435
function startGroup(config: WranglerActionConfig, name: string): void {

0 commit comments

Comments
 (0)