Skip to content

Commit 817cab7

Browse files
Merge pull request #53 from Rajesh-Nagarajan-11/fixxx
fix
2 parents 2685fce + 9e96b39 commit 817cab7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/build-and-preview-site.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ jobs:
7474
echo "Warning: Neither public nor public-dir found after extraction"
7575
fi
7676
77+
- name: Remove CNAME from preview build
78+
if: github.event_name == 'pull_request_target'
79+
run: |
80+
# Remove CNAME from the built site to prevent DNS redirect to badges.layer5.io
81+
# This ensures PR previews use the default GitHub Pages domain
82+
if [ -f public/CNAME ]; then
83+
rm public/CNAME
84+
echo "CNAME removed from preview build to prevent DNS redirect"
85+
else
86+
echo "No CNAME file found in public directory"
87+
fi
88+
7789
- name: Deploy Preview
7890
if: github.event_name == 'pull_request_target' && github.event.action != 'closed'
7991
uses: rossjrw/[email protected]

0 commit comments

Comments
 (0)