@@ -124,22 +124,18 @@ jobs:
124124 echo "- **Target Worker**: \`codingcatdev-dev\`" >> $GITHUB_STEP_SUMMARY
125125
126126 if [ -n "$PREVIEW_URL" ]; then
127- cat << 'EOF' > pr_comment.md
128- # ## ⚡ Cloudflare Worker Preview Ready!
129-
130- | Environment | URL |
131- |---|---|
132- | **PR Preview** | [${PREVIEW_URL}](${PREVIEW_URL}) |
133- | **Dev Custom Domain** | [https://dev.codingcat.dev](https://dev.codingcat.dev) |
134-
135- - **Worker Version ID**: `${VERSION_ID}`
136- - **Protection**: Restricted to `@codingcat.dev` accounts via Cloudflare Zero Trust Access
137- EOF
138- # Replace placeholder variables with actual values in pr_comment.md
139- sed -i "s|\${PREVIEW_URL}|${PREVIEW_URL}|g" pr_comment.md
140- sed -i "s|\${VERSION_ID}|${VERSION_ID}|g" pr_comment.md
141-
142- # Check if bot has already posted a preview comment on this PR
127+ {
128+ echo "### ⚡ Cloudflare Worker Preview Ready!"
129+ echo ""
130+ echo "| Environment | URL |"
131+ echo "|---|---|"
132+ echo "| **PR Preview** | [${PREVIEW_URL}](${PREVIEW_URL}) |"
133+ echo "| **Dev Custom Domain** | [https://dev.codingcat.dev](https://dev.codingcat.dev) |"
134+ echo ""
135+ echo "- **Worker Version ID**: \`${VERSION_ID}\`"
136+ echo "- **Protection**: Restricted to \`@codingcat.dev\` accounts via Cloudflare Zero Trust Access"
137+ } > pr_comment.md
138+
143139 COMMENT_ID=$(gh api "repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" --jq '.[] | select((.user.login=="github-actions[bot]" or .user.login=="app/github-actions") and (.body | contains("Cloudflare Worker Preview Ready"))) | .id' | tail -n 1)
144140
145141 if [ -n "$COMMENT_ID" ]; then
150146 fi
151147 env :
152148 CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
153- CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID || 'c46bd0f3b9ed47b8692cca098030edbf' }}
149+ CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
154150 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
155151 PR_NUMBER : ${{ github.event.pull_request.number }}
156152 PR_TITLE : ${{ github.event.pull_request.title }}
0 commit comments