Skip to content

Commit d4ee210

Browse files
Copilotskjnldsv
andauthored
fix: use netlify --json for URL capture; soften no-RST-files note
Agent-Logs-Url: https://github.com/nextcloud/documentation/sessions/b0dedceb-7f42-453c-9ddf-a0d130183f1d Co-authored-by: skjnldsv <14975046+skjnldsv@users.noreply.github.com>
1 parent af5e3c9 commit d4ee210

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/sphinxbuild.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -634,15 +634,16 @@ jobs:
634634
continue-on-error: true
635635
run: |
636636
set +e
637-
output=$(netlify deploy \
637+
json=$(netlify deploy \
638638
--dir=netlify-deploy \
639639
--site="${{ secrets.NETLIFY_SITE_ID }}" \
640640
--auth="${{ secrets.NETLIFY_AUTH_TOKEN }}" \
641641
--alias="pr-${{ github.event.pull_request.number }}" \
642-
--message="Preview for PR #${{ github.event.pull_request.number }}" 2>&1)
642+
--message="Preview for PR #${{ github.event.pull_request.number }}" \
643+
--json 2>/dev/null)
643644
exit_code=$?
644-
echo "$output"
645-
preview_url=$(echo "$output" | grep -oP 'Website URL:\s+\K\S+' | head -1)
645+
echo "$json"
646+
preview_url=$(echo "$json" | jq -r '.deploy_url // .url // ""' 2>/dev/null || echo "")
646647
echo "url=${preview_url}" >> "$GITHUB_OUTPUT"
647648
exit $exit_code
648649
@@ -693,7 +694,7 @@ jobs:
693694
'</details>',
694695
].join('\n');
695696
} else if (rstFiles.length === 0) {
696-
changedSection = '\n_No RST documentation files changed._';
697+
changedSection = '\n_No RST documentation pages changed in this PR._';
697698
}
698699
699700
// Compose the full comment body

0 commit comments

Comments
 (0)