Skip to content

Commit ec49507

Browse files
committed
Fix Fern preview url parsing
1 parent 1c95c32 commit ec49507

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/fern-docs-preview.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ jobs:
3333
run: |
3434
output=$(npm run docs:preview 2>&1)
3535
echo "$output"
36-
url=$(echo "$output" | grep -oP 'https://[^\s]+buildwithfern\.com[^\s]+' | tail -1)
36+
url=$(printf '%s\n' "$output" \
37+
| grep -oP 'https://[A-Za-z0-9./?&=_:%#~+-]*buildwithfern\.com[A-Za-z0-9./?&=_:%#~+-]*' \
38+
| tail -n 1 \
39+
| perl -CS -pe 's/\x{200B}//g; s/%E2%80%8B$//i')
40+
3741
echo "url=$url" >> "$GITHUB_OUTPUT"
3842
env:
3943
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
@@ -47,5 +51,5 @@ jobs:
4751
issue_number: context.issue.number,
4852
owner: context.repo.owner,
4953
repo: context.repo.repo,
50-
body: `📖 **Docs preview:** ${{ steps.preview.outputs.url }}`
54+
body: '📖 **Docs preview:** ${{ steps.preview.outputs.url }}'
5155
})

0 commit comments

Comments
 (0)