Skip to content

Commit

Permalink
Merge branch 'issue/NT-fix-add-pr-url-https' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-potter committed Jun 14, 2024
2 parents 988cf3e + a322eee commit e9701fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ jobs:
with:
url: www.example.com
caption: Test Link
- name: Add existing https link to PR
uses: phase2/octane-actions/actions/add-pr-url@develop
with:
url: https://www.example.com
caption: Test Https Link
- name: Add second url link to PR
uses: phase2/octane-actions/actions/add-pr-url@develop
with:
Expand Down
8 changes: 6 additions & 2 deletions actions/add-pr-url/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ runs:
let now = new Date();
console.log(now.toUTCString());
console.log(context.payload)
let url = `${{ inputs.url }}`;
if (! url.startsWith('http')) {
url = `https://${url}`;
}
let caption = '${{ inputs.caption }}'
if (! caption) {
caption = 'View environment ${{ inputs.url }}'
caption = 'View environment ${url}'
}
const snippet = `<h3><a href="https://${{ inputs.url }}">:arrow_forward:&nbsp;&nbsp;${caption}</a></h3>`
const snippet = `<h3><a href="${url}">:arrow_forward:&nbsp;&nbsp;${caption}</a></h3>`
const owner = context.payload.repository.owner.login
const repo = context.payload.repository.name
let fetch_body = '${{ inputs.fetch }}'
Expand Down

0 comments on commit e9701fe

Please sign in to comment.