Skip to content

Restrict GitHub Pages deploys to main pushes only - #29

Merged
kasperg3 merged 1 commit into
mainfrom
copilot/remove-monthly-release
Jun 21, 2026
Merged

Restrict GitHub Pages deploys to main pushes only#29
kasperg3 merged 1 commit into
mainfrom
copilot/remove-monthly-release

Conversation

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Monthly release activity was triggering the Pages deploy workflow via tag events, which could overwrite or destabilize the live site. This change narrows deployment triggers so only main pushes can publish to GitHub Pages.

  • Deploy trigger scope

    • Removed tag-based trigger (v*) from .github/workflows/deploy.yml.
    • Keeps pull-request builds intact while preventing release-tag deployments.
  • Deploy job guardrail

    • Tightened the deploy job condition to allow publishing only on refs/heads/main.
    • Eliminates tag-path deploys even if additional push events are introduced later.
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

# ...
deploy:
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'

@kasperg3
kasperg3 marked this pull request as ready for review June 21, 2026 10:25
Copilot AI review requested due to automatic review settings June 21, 2026 10:25
@kasperg3
kasperg3 merged commit cf9aad4 into main Jun 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the GitHub Actions deployment workflow for GitHub Pages so publishing can only occur from direct pushes to the main branch, preventing release tag activity from triggering (and potentially overwriting) the live Pages site.

Changes:

  • Removed the push.tags: ['v*'] trigger from the Pages deploy workflow.
  • Updated the deploy job if: condition to only allow deployments on push events where github.ref == 'refs/heads/main'.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants