Skip to content

Commit

Permalink
chore: vercel preview comment 예쁘게 🀩
Browse files Browse the repository at this point in the history
  • Loading branch information
WooWan committed Jul 28, 2024
1 parent a4d3e3a commit e8b3632
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/deploy-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,29 @@ jobs:
run: |
output=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})
echo "::set-output name=url::$(echo "$output" | grep -oP 'https://.*\.vercel\.app')"
- name: Get Project Name
id: project-name
run: echo "name=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_OUTPUT

- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: Preview deployed to
- name: Create or Update Comment
body-includes: "The latest updates on your projects"

- name: Create or Update Comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Preview deployed to: ${{ steps.deploy.outputs.url }}
Last updated: ${{ github.event.pull_request.updated_at }}
edit-mode: replace
**The latest updates on your projects**.
| Name | Status | Preview | Updated (UTC) |
| ---- | ------ | ------- | ------------- |
| **${{ steps.project-name.outputs.name }}** | βœ… Ready ([Inspect](https://vercel.com/dashboard)) | [Visit Preview](${{ steps.deploy.outputs.url }}) | ${{ github.event.pull_request.updated_at | date('YYYY-MM-DD HH:mm:ss', '+9 hours') }} |
edit-mode: replace

0 comments on commit e8b3632

Please sign in to comment.