Skip to content

Commit 2ba469c

Browse files
rfayclaude
andcommitted
Prioritize stable branch URLs over commit-specific URLs
- Prefer steps.pages.outputs.url (branch-based) over deployment-url (commit-based) - Add logging to show which URL type is being used - Ensure fork PRs get stable pr-{number}.ddev-com-front-end.pages.dev URLs - Update comment text to indicate URL type for clarity 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7fc306c commit 2ba469c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/cloudflare-preview-forks.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,20 @@ jobs:
334334
ALT_URL: ${{ steps.pages.outputs.url }}
335335
with:
336336
script: |
337-
const url = process.env.DEPLOYMENT_URL || process.env.ALT_URL || '';
337+
// Prefer stable branch URL over commit-specific URL
338+
const branchUrl = process.env.ALT_URL;
339+
const commitUrl = process.env.DEPLOYMENT_URL;
340+
const url = branchUrl || commitUrl || '';
341+
338342
if (!url) {
339343
core.info('No preview URL found from Cloudflare action outputs.');
340344
return;
341345
}
342-
const body = `Cloudflare Pages preview: ${url}`;
346+
347+
const urlType = branchUrl ? 'stable branch preview' : 'deployment preview';
348+
const body = `Cloudflare Pages ${urlType}: ${url}`;
349+
350+
core.info(`Using ${urlType} URL: ${url}`);
343351
const { data: comments } = await github.rest.issues.listComments({
344352
owner: context.repo.owner,
345353
repo: context.repo.repo,

0 commit comments

Comments
 (0)