Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/remote-cache-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,24 @@ jobs:
- name: Explain staging deployment availability
if: >-
always() && github.event_name == 'pull_request' &&
(github.event.pull_request.head.repo.full_name != github.repository || github.event.pull_request.user.login == 'dependabot[bot]')
(github.event.pull_request.head.repo.full_name != github.repository || github.event.pull_request.user.type == 'Bot')
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |
await core.summary.addHeading('Remote cache staging').addRaw(
'Fork and Dependabot PRs run local checks without Cloudflare credentials. ' +
'Fork PRs and PRs opened by bots, such as Dependabot and Renovate, run local checks without Cloudflare credentials. ' +
'A maintainer can copy the reviewed commit to an internal branch and open a PR to deploy to staging. ' +
'No live deployment passed verification for this PR.'
).write();

deploy:
name: Deploy staging and run smoke tests
needs: check
# Bot PRs, such as dependency updates, carry unreviewed third-party code. Keep them away from
# the Cloudflare credentials, like fork PRs.
if: >-
vars.REMOTE_CACHE_DEPLOY_ENABLED == 'true' &&
github.event.pull_request.user.login != 'dependabot[bot]' &&
github.event.pull_request.user.type != 'Bot' &&
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
(github.event_name != 'workflow_dispatch' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
runs-on: ubuntu-latest
Expand Down Expand Up @@ -115,7 +117,7 @@ jobs:
name: Update PR staging verification instructions
if: >-
always() && github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]'
github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.type != 'Bot'
needs: [check, deploy]
runs-on: ubuntu-latest
timeout-minutes: 5
Expand Down
2 changes: 1 addition & 1 deletion docs/e2e-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Set these **repository variables**, which the notification job also needs:

Enable R2 in the account. The token must allow resource provisioning, updates, and fixture data access. No custom domain or DNS permission is needed. Do not attach production bindings or secrets to the staging Worker.

The workflow exposes Cloudflare credentials only to deployment and smoke-test commands. Dependency installation runs before those credentials enter the step environment. Internal PR contributors must be trusted to change deployment code. Fork and Dependabot PRs run local checks without Cloudflare credentials. Their check summary explains why staging deployment is unavailable; they receive no deployment comment. To deploy a fork change to staging, a maintainer must copy the reviewed commit to a branch in this repository and open a PR.
The workflow exposes Cloudflare credentials only to deployment and smoke-test commands. Dependency installation runs before those credentials enter the step environment. Internal PR contributors must be trusted to change deployment code. Fork PRs and PRs opened by bots, such as Dependabot and Renovate, run local checks without Cloudflare credentials, because a dependency update brings in third-party code that nobody has reviewed yet. Their check summary explains why staging deployment is unavailable; they receive no deployment comment. To deploy a fork or bot change to staging, a maintainer must copy the reviewed commit to a branch in this repository and open a PR.

GitHub can suppress `pull_request` workflows when a PR has merge conflicts. Resolve the conflicts to run its checks and deployment. Manual deployment dispatches use the default branch and cannot select an arbitrary PR revision. There is no closed-PR trigger, resource teardown job, or cleanup workflow.

Expand Down
Loading