Del: PR Comment
This commit is contained in:
@@ -51,25 +51,4 @@ jobs:
|
||||
echo "deploy_id=$DEPLOY_ID" >> $GITHUB_OUTPUT
|
||||
|
||||
PREVIEW_URL=$(jq -r '.result.url' cf_response.json)
|
||||
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"
|
||||
echo "preview_url=$PREVIEW_URL" >> $GITHUB_OUTPUT
|
||||
Reference in New Issue
Block a user