Skip to content

Commit 011d01f

Browse files
committed
fix(ci): fix yaml indentation and clean up secrets syntax in workflows
1 parent ce71b9c commit 011d01f

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -150,7 +146,7 @@ EOF
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 }}

‎.github/workflows/deploy-workers.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: pnpm --filter @codingcatdev/site exec wrangler deploy
4747
env:
4848
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
49-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID || 'c46bd0f3b9ed47b8692cca098030edbf' }}
49+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
5050

5151
deploy-production:
5252
if: github.ref == 'refs/heads/main'
@@ -80,4 +80,4 @@ jobs:
8080
run: pnpm --filter @codingcatdev/site exec wrangler deploy --env production
8181
env:
8282
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
83-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID || 'c46bd0f3b9ed47b8692cca098030edbf' }}
83+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

0 commit comments

Comments
 (0)