Skip to content

restrict deployment to main branch - #7

Merged
cburgard merged 3 commits into
mainfrom
deploy-only-on-main
Aug 31, 2026
Merged

restrict deployment to main branch#7
cburgard merged 3 commits into
mainfrom
deploy-only-on-main

Conversation

@cburgard

@cburgard cburgard commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

only the main branch should be able to deploy

only the main branch should be able to deploy
@cburgard

cburgard commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@mmikhasenko please review

@szabo137 szabo137 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.

Thanks for taking care of this. I made a small suggestion for improvement.

Comment thread .github/workflows/docs.yml Outdated
needs: build

# Deploy only after a push to the main branch.
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems this is also triggered if there is a direct push on main; not coming from a PR. I propose that we do not allow any direct push on main, maybe with the correct repo settings, or with a more constrained rule here. For instance:

if: >
      github.event.action == 'closed' &&
      github.event.pull_request.merged == true &&
      github.event.pull_request.base.ref == 'main'

(not tested)

This would trigger the deployment only if there is a merged PR to main.

@szabo137 szabo137 mentioned this pull request Aug 28, 2026
@cburgard
cburgard merged commit 7b74e3d into main Aug 31, 2026
2 checks passed
@cburgard
cburgard deleted the deploy-only-on-main branch August 31, 2026 13:34
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.

2 participants