ci(docs/preview): Post comment to PR for preview deployments

The if condition is designed to make a new comment only once per PR. It
could probably use some further selectivity to only do this for specific
changed files, but we can cross that bridge when we get to it.
This commit is contained in:
Julian Anderson authored and Ellis Git committed 2026-11-28 16:30:04 +00:00
1 parent f0198d6254
commit 8ad4374274
1 file changed
+10
+10
View File
@@ -81,3 +81,13 @@ jobs:
--expires 14 \
--comment "${{ forgejo.sha }}" \
--verbose
- name: Post comment to PR
if: github.ref != 'refs/heads/main' && forgejo.event.name == 'pull_request'
run: |
if curl -s ${{ forgejo.api_url }}/repos/${{ forgejo.repository }}/issues/${{ forgejo.event.number }}/comments | grep -qv 'PR-PREVIEW-MARKER'; then
echo -n 'Posting comment: '
curl -s -X POST ${{ forgejo.api_url }}/repos/${{ forgejo.repository }}/issues/${{ forgejo.event.number }}/comments \
-H 'Authorization: token ${{ forgejo.token }}' \
--json '{"body":"<!--PR-PREVIEW-MARKER-->Preview ready: https://preview.continuwuity.org/@${{ forgejo.event.number }}/"}'
fi