tzkhan / pr-update-action

GitHub Action that updates a pull request with information extracted from branch name

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use custom variables in template body?

hxtree opened this issue · comments

I'd like to be able to populate a sandbox URL in the template body. Is this available? Any recommendation on how to proceed?

I'd probably need to do some parsing beforehand, could be done in a prior job e.g. branch name starts off as "hotfix/jira-2434-fixed-whitespace-issue".

# kebab-case branch naming convention pattern:  
# {type}/{id}-{short-description}
subdomain-suffix = '-app';
subdomain = "{id}-{short-description}{subdomain-suffix}"
domain = 'example.com';
url = https://{subdomain}.{domain}/

Sandbox: %url%

Thus the template body gets updated like so:

Sandbox: https://jira-2434-fixed-whitespace-issue-app.sandbox.example.com/

Thank you!