Del: PR Comment
This commit is contained in:
@@ -52,24 +52,3 @@ jobs:
|
|||||||
|
|
||||||
PREVIEW_URL=$(jq -r '.result.url' cf_response.json)
|
PREVIEW_URL=$(jq -r '.result.url' cf_response.json)
|
||||||
echo "preview_url=$PREVIEW_URL" >> $GITHUB_OUTPUT
|
echo "preview_url=$PREVIEW_URL" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Comment to PR (only on PR)
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
GITEA_SERVER_URL: ${{ secrets.GITEA_SERVER_URL }}
|
|
||||||
run: |
|
|
||||||
PR_NUMBER="${{ github.event.pull_request.number }}"
|
|
||||||
REPO="${{ github.repository }}"
|
|
||||||
URL="${{ steps.deploy.outputs.preview_url }}"
|
|
||||||
DEPLOY_ID="${{ steps.deploy.outputs.deploy_id }}"
|
|
||||||
|
|
||||||
COMMENT="🚀 **Cloudflare Pages Preview**
|
|
||||||
URL: ${URL}
|
|
||||||
Deployment ID: \`${DEPLOY_ID}\`"
|
|
||||||
|
|
||||||
curl -X POST \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-d "{\"body\": \"${COMMENT}\"}" \
|
|
||||||
"${GITEA_SERVER_URL}/api/v1/repos/${REPO}/issues/${PR_NUMBER}/comments"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user