Skip to content

Commit 6794200

Browse files
committed
Prevent automatic GH Pages deployments from feature branches
Adds a condition to the GitHub Pages deploy job to prevent it from running automatically when the branch name contains a hyphen. This typically filters out feature or development branches, ensuring that only designated branches (e.g., `main`) or manual workflow dispatches trigger a deployment. This avoids unintended releases of incomplete or development content to GitHub Pages.
1 parent efbc7e8 commit 6794200

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
deploy:
4141
needs: build
4242
runs-on: ubuntu-latest
43+
if: github.event_name == 'workflow_dispatch' || !contains(github.ref_name, '-')
4344
environment:
4445
name: github-pages
4546
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)