Last active
March 19, 2023 21:06
-
-
Save skullface/87e4679148f6b8cebe657f7c270c8fbe to your computer and use it in GitHub Desktop.
GitHub action to edit pull request with Vercel preview deploy URL for the branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Link to Vercel preview deploy | |
on: | |
pull_request: | |
types: [opened] | |
jobs: | |
update-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get branch name | |
shell: bash | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV | |
id: extract_branch | |
- name: Append PR body with preview deploy URL | |
uses: devindford/[email protected] | |
with: | |
repo-token: "${{ secrets.GITHUB_TOKEN }}" | |
body-template: | | |
--- | |
🔗 **Preview**: https://<project-name>-git-${{ env.BRANCH_NAME }}.<scope-slug>.vercel.app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment