Skip to content

Commit 34d159e

Browse files
revert some changes to release name
1 parent daeb639 commit 34d159e

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

.github/workflows/docs-preview.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
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
@@ -66,10 +66,8 @@ jobs:
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

0 commit comments

Comments
 (0)