File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 # Create a unique name for this deployment using the PR number
4444 # This helps track which PR preview is which
4545 - name : Configure release name
46- run : echo "RELEASE_NAME=pr-${{ github.event.pull_request. number || github.run_id }}" >> $GITHUB_ENV
46+ run : echo "RELEASE_NAME=pr-${{ github.event.number }}" >> $GITHUB_ENV
4747
4848 # Create a deployment status on GitHub to track the deployment progress
4949 # This shows up in the PR's "Deployments" section
6666 NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
6767 run : |
6868 npm install -g netlify-cli
69- ALIAS="pr-${{ github.event.pull_request.number || github.run_id }}"
70- netlify deploy --dir=_site --alias="$ALIAS" --json > deploy.json
71- DEPLOY_URL=$(python -c "import json; d=json.load(open('deploy.json')); \
72- print(d.get('deploy_ssl_url') or d.get('deploy_url') or '')")
69+ netlify deploy --dir=_site/ --alias="pr-${{ github.event.number }}" 2>&1 | tee deploy.log
70+ DEPLOY_URL=$(grep -oP 'https://[^\s]+' deploy.log | grep -E '(netlify\.app|--.*\.netlify\.app)' | head -n 1)
7371 echo "url=${DEPLOY_URL}" >> $GITHUB_OUTPUT
7472
7573 # Update the GitHub deployment status with success/failure and the preview URL
You can’t perform that action at this time.
0 commit comments