Introduce optional `deploymentId` input for custom deployment URLs
Current situation
Currently, the id or name of the job running the surge-preview action is used to create a specific Surge URL for the current deployment. This allows multiple surge deployments from a single workflow or multiple workflows.
The preview website URL is generated like this: https://{{repository.owner}}-{{repository.name}}-{{job.name}}-pr-{{pr.number}}.surge.sh
This job id/name is also used to identify the PR comment related to the deployment.
Drawbacks
- For long org or repo names, the subdomain can exceed 63 characters and become inaccessible (see https://github.com/bonitasoft/actions/issues/101). In this case, the job name must be changed, which is not convenient and reduces workflow readability.
- To support forked repos, several workflows are needed for deployment and teardown, and they need to share the same job id/name (see https://github.com/afc163/surge-preview/pull/320).
- If the build process needs to know the Surge URL, it must use the same job id/name.
- Having the same job id/name is not natural for jobs not doing the same things is not natural, and not very explicit
Proposal
Introduce a new optional input called deploymentIdentifier (name can be discussed). It defaults to the job id/name (no breaking change).
- If set,
deploymentIdentifierwill be used instead of the job id/name when generating the Surge URL and for PR comment identification. - This input should only accept alpha-numeric characters.
This should make the process more flexible and thinks more explicit.
Welcome to GitAuto! 🎉 Click the checkbox below to generate a PR!
- [ ] Generate PR
@tbouffard, You have 3 requests left in this cycle which refreshes on 2025-07-06 01:47:00+00:00. If you have any questions or concerns, please contact us at [email protected].
If you agree that this feature is valuable, I can propose a PR. Just let me know.
@tbouffard Sure, PR is welcome~
@afc163 Great, I am starting working on this.
As for the new entry, I'd prefer to call it deploymentId.
Do you have any wishes regarding this name, or should I continue with my new proposal?
Proposed PR is ready for review: https://github.com/afc163/surge-preview/pull/325
Hi, @tbouffard. I'm Dosu, and I'm helping the surge-preview team manage their backlog and am marking this issue as stale.
Issue Summary:
- You proposed adding an optional
deploymentIdentifier(laterdeploymentId) input to the surge-preview action. - This change aims to replace job id/name for Surge URL generation to fix long subdomain issues and improve clarity for forked repos.
- The maintainer welcomed the idea and encouraged a PR.
- You submitted a PR for review at afc163/surge-preview#325.
- The issue is currently being addressed through the submitted PR.
Next Steps:
- Please confirm if this issue is still relevant with the latest version of surge-preview by commenting here.
- If no further updates are provided, I will automatically close this issue in 7 days.
Thank you for your understanding and contribution!
Hi this issue is still relevant and the PR is still accurate. Please don't mark them as stale.
@afc163 The user has confirmed that the issue and the related PR are still relevant and accurate, so it should not be marked as stale. Could you please assist with the next steps?