Skip to content

Documentation workflow runs in template instance fail on pull-requests #588

@matt-graham

Description

@matt-graham

Describe the Bug

The .github/workflows/docs.yaml file created by the cookiecutter template post #578 being merged tries to deploy the built documentation to GitHub Pages irrespective of the event which triggered workflow, and so fails on pull-requests as the default environment configuration for deploy to GitHub Pages Action is set to only allow deploying from main branch. In reality we don't want to update deployed documentation site directly from pull-requests so the deploy job should not be run if triggered by a PR. See luigigisolfi/transient_smash#14 and associated run logs for instance of this

To Reproduce

Create a package with template, push generated files to main branch on GitHub and open a PR against main - docs workflow will fail in deploy job.

Expected Behaviour

deploy job not run on pull-requests

Actual Behaviour

deploy job attempts to run and fails

Version In Use

58c1968

Additional Context

- Cookiecutter version:
- Operating system:
- Python version:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions