mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-28 19:37:32 +00:00
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:
1 parent
f0198d6254
commit
8ad4374274
1 file changed
+10
@@ -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
|
||||
Reference in new issue
Block a user