File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : PR Preview Links
2+ permissions :
3+ contents : read
4+ pull-requests : write
5+
6+ on :
7+ pull_request :
8+ types : [opened]
9+
10+ jobs :
11+ preview-comment :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Encode branch name
15+ id : encode-branch
16+ run : |
17+ encoded=$(printf '%s' "${{ github.head_ref }}" | jq -sRr @uri)
18+ echo "branch=$encoded" >> $GITHUB_OUTPUT
19+
20+ - name : Find existing comment
21+ uses : peter-evans/find-comment@v3
22+ id : find-comment
23+ with :
24+ issue-number : ${{ github.event.pull_request.number }}
25+ comment-author : " github-actions[bot]"
26+ body-includes : " <!-- preview-links -->"
27+
28+ - name : Create preview comment
29+ if : steps.find-comment.outputs.comment-id == ''
30+ uses : peter-evans/create-or-update-comment@v4
31+ with :
32+ issue-number : ${{ github.event.pull_request.number }}
33+ body : |
34+ <!-- preview-links -->
35+ ## Preview Links
36+
37+ - [Backend API](https://clerk.com/docs/reference/${{ steps.encode-branch.outputs.branch }}/backend-api)
38+ - [Frontend API](https://clerk.com/docs/reference/${{ steps.encode-branch.outputs.branch }}/frontend-api)
You can’t perform that action at this time.
0 commit comments