Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 1, 2026

GitHub Pages environment protection rules reject deployments from tag refs. The workflow was attempting to deploy when triggered by release events, causing failures like: "Tag 'v3.2.7' is not allowed to deploy to github-pages due to environment protection rules."

Changes

  • Removed release event from deployment conditions in .github/workflows/docs.yml
  • Deployment now only occurs on push to master or workflow_dispatch
  • Documentation still builds on releases for validation, just doesn't deploy
# Before
if: github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'

# After
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'

Documentation updates will continue to deploy automatically on merges to master.

Original prompt

This workflow: https://github.com/jacksonpradolima/gsp-py/blob/master/.github/workflows/docs.yml

Failed in Deploy to GitHub pages with the following error:

  • Tag "v3.2.7" is not allowed to deploy to github-pages due to environment protection rules.
  • The deployment was rejected or didn't satisfy other protection rules.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Jan 1, 2026
The deployment was failing because GitHub Pages environment protection
rules don't allow deployments from tags. This fix removes the 'release'
event from the deployment conditions while keeping it for the build step
to validate docs on releases.

The workflow will now only deploy to GitHub Pages on:
- Push to master branch
- Manual workflow_dispatch trigger

Co-authored-by: jacksonpradolima <[email protected]>
Copilot AI changed the title [WIP] Fix GitHub Pages deployment error for version tag Fix GitHub Pages deployment failure on release events Jan 1, 2026
Copilot AI requested a review from jacksonpradolima January 1, 2026 19:04
@jacksonpradolima jacksonpradolima marked this pull request as ready for review January 1, 2026 19:04
Copilot AI review requested due to automatic review settings January 1, 2026 19:04
Copy link
Contributor

Copilot AI left a comment

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 fixes a GitHub Pages deployment failure that occurred when the workflow was triggered by release events. Tag refs are rejected by GitHub Pages environment protection rules, causing deployment failures.

Key Changes:

  • Removed release event from deployment conditions in both the "Upload Pages artifact" and "Deploy to GitHub Pages" steps
  • Deployment now only occurs on push to master branch or manual workflow_dispatch triggers
  • Documentation still builds on releases for validation purposes without attempting deployment

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

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 1, 2026

@jacksonpradolima jacksonpradolima merged commit 4c03dd0 into master Jan 1, 2026
12 checks passed
@jacksonpradolima jacksonpradolima deleted the copilot/fix-github-pages-deployment branch January 18, 2026 16:21
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