-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1.24 KB
/
preview-url.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Capture Vercel preview URL
on:
issue_comment:
types: [edited]
jobs:
capture_vercel_preview_url:
name: Capture Vercel preview URL
runs-on: ubuntu-latest
steps:
- uses: aaimio/[email protected]
id: vercel_preview_url
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Below is but an example of what you could do with the preview URL.
# The preview URL is accessed through ${{ steps.<step_id>.outputs.vercel_preview_url }}
- uses: actions/github-script@v7
with:
script: |
const previewURL = "${{ steps.vercel_preview_url.outputs.vercel_preview_url }}".match(/https:\/\/vercel\.live\/open-feedback\/(.+.vercel.app).*/)[1];
if (previewURL) {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `The preview URL are:
1. https://${previewURL}/v2/username/PikiLee
2. https://${previewURL}/v2/username/PikiLee?tone=yellow&include=name,avatar,daysOnGithubText
Please visit the URL to review the changes.`
});
}