diff --git a/.github/workflows/remote-cache-deploy.yml b/.github/workflows/remote-cache-deploy.yml index 1034f80..3bdad02 100644 --- a/.github/workflows/remote-cache-deploy.yml +++ b/.github/workflows/remote-cache-deploy.yml @@ -44,12 +44,12 @@ 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(); @@ -57,9 +57,11 @@ jobs: 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 @@ -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 diff --git a/docs/e2e-plan.md b/docs/e2e-plan.md index e2efed5..3db6563 100644 --- a/docs/e2e-plan.md +++ b/docs/e2e-plan.md @@ -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.