Skip to content

Conversation

@dannywillems
Copy link
Member

Summary

Fix the error on PRs:

Branch "refs/pull/*/merge" is not allowed to deploy to github-pages due to environment protection rules.

Problem

The doc-and-spec job had environment: github-pages set at the job level, which applies to all matrix runs including PRs. GitHub's environment protection rules then blocked the entire job, even though the actual deploy steps only ran conditionally on push to master.

Solution

Split the deployment into a separate deploy-pages job that:

  • Only runs on push to master (job-level if condition)
  • Has the github-pages environment declaration
  • Depends on doc-and-spec to ensure all tests pass first
  • Rebuilds the book and rustdoc for deployment

This ensures the environment protection rules only apply when actually deploying to GitHub Pages.

Test plan

  • Verify CI passes on this PR (no environment error)
  • After merge, verify deployment still works on push to master

Split the deploy-pages job from doc-and-spec to fix the error:
"Branch refs/pull/*/merge is not allowed to deploy to github-pages
due to environment protection rules"

The issue was that the `environment: github-pages` block was set at
the job level for doc-and-spec, which applies to all matrix runs
including PRs. GitHub's environment protection rules then blocked
the job even though the actual deploy steps only ran on master.

The fix creates a separate deploy-pages job that:
- Only runs on push to master (job-level condition)
- Has the github-pages environment declaration
- Depends on doc-and-spec to ensure tests pass first
- Rebuilds the book and rustdoc for deployment
@dannywillems dannywillems requested a review from iostat January 29, 2026 19:36
@dannywillems dannywillems self-assigned this Jan 29, 2026
@dannywillems dannywillems moved this to In Review in Rust node Jan 29, 2026
@dannywillems dannywillems merged commit 3d9879d into master Jan 29, 2026
31 of 33 checks passed
@dannywillems dannywillems deleted the dw/fix-pages-deployment branch January 29, 2026 20:52
@yamimaio yamimaio moved this from In Review to Done in Rust node Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants