opensafely / opensafely/documentation

Enable site preview for Dependabot builds

Open
#930 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
48
Forks
10
Avg merge
2d 19h
Merged PRs (30d)
17

Description

We're now building the site via GitHub Actions and pushing that to Cloudflare Pages ourselves to deploy the site, following #921.

This requires secrets to deploy. Dependabot does not have access to these secrets (#929). #930 simply skips the publish step for Dependabot PRs, which means you don't get an automatic preview. This isn't too big a problem as most changes are likely fairly innocuous, provided the site builds.

If we want to resolve it, we would either need to:

  • use pull_request_target as the workflow trigger (⚠️ which has security implications which we would be better avoiding)
  • or (probably better) separating build and deploy steps by building the site and uploading artifacts in one workflow, then triggering deployment of those artifacts via workflow_run, with secrets access.

Alternatively, if Cloudflare Pages ever improves to allow builds with newer Python, we could consider allowing Cloudflare Pages to do the build and deploy. This removes this problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the GitHub Actions workflow introduced by #921 and the Dependabot secret limitation described in #929. Compare separating the build and artifact upload from deployment via workflow_run with the other options, including their security implications. Done means Dependabot pull requests receive site previews without exposing deployment secrets.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
ci-cd, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.