diff --git a/deploy-storybook/action.yml b/deploy-storybook/action.yml index df49e68d..2bdfd094 100644 --- a/deploy-storybook/action.yml +++ b/deploy-storybook/action.yml @@ -170,8 +170,9 @@ runs: with: github-token: ${{ env.GITHUB_TOKEN }} script: | + const trimSuffix = (name) => name.endsWith('-') ? name.slice(0, -1) : name const { issue: { number: issue_number }, repo: { owner, repo } } = context - const name = ['${{ env.RELEASE }}', '${{ steps.repo.outputs.repository_name }}-storybook'].join('-').substring(0, 45) + const name = trimSuffix(['${{ env.RELEASE }}', '${{ steps.repo.outputs.repository_name }}-storybook'].join('-').substring(0, 63)) const body = `Storybook temploy is available at https://${name}.toptal.rocks :tada:` const number = issue_number || ${{ env.PR_NUMBER }} github.rest.issues.createComment({ issue_number: number, owner, repo, body })