Skip the runner Docker e2e job on pull requests from forks
GitHub passes no repository variables to fork pull requests, so DIFFINERY_RUNS_ON is empty there and the job lands on GitHub's ubuntu runner, where its check for Diffinery's docker wrapper fails every time. Skip the job for forks; upstream branches and main still run it, with the check unchanged. CONTRIBUTING.md says how a maintainer runs it.
2 files changed+9−0
modified.github/workflows/e2e.yml+3−0View file
| @@ -89,9 +89,12 @@ | ||
| 89 | 89 | # Docker as the hosted runner image runs it, with this change's docker wrapper, daemon config |
| 90 | 90 | # and agent (its registry relay). It needs a Diffinery hosted runner, for the real dockerd: on |
| 91 | 91 | # Diffinery, or on GitHub with DIFFINERY_RUNS_ON=diffinery. On GitHub's own runners it fails. |
| 92 | + # Pull requests from forks get no repository variables, so they would land on GitHub's runners: | |
| 93 | + # they skip the job, and a maintainer runs it by pushing the branch to this repository. | |
| 92 | 94 | # A daemon an earlier step started is stopped first, so the first uses below start it afresh. |
| 93 | 95 | runner-docker: |
| 94 | 96 | name: End-to-end (runner Docker) |
| 97 | + if: ${{ !github.event.pull_request.head.repo.fork }} | |
| 95 | 98 | runs-on: ${{ vars.DIFFINERY_RUNS_ON || 'ubuntu-latest' }} |
| 96 | 99 | timeout-minutes: 20 |
| 97 | 100 | steps: |
modifiedCONTRIBUTING.md+6−0View file
| @@ -57,6 +57,12 @@ | ||
| 57 | 57 | end-to-end shards before they merge. Tests must not depend on the speed of the machine |
| 58 | 58 | they run on. |
| 59 | 59 | |
| 60 | +The "End-to-end (runner Docker)" job needs one of Diffinery's own runners, which GitHub | |
| 61 | +picks through the repository variable `DIFFINERY_RUNS_ON`. GitHub doesn't pass repository | |
| 62 | +variables to pull requests from forks, so on a fork's pull request that job is skipped, | |
| 63 | +not failed. If your change touches the runner's Docker support (`containers/runner`), a | |
| 64 | +maintainer runs the job by pushing your branch to this repository. | |
| 65 | + | |
| 60 | 66 | ## Conventions |
| 61 | 67 | |
| 62 | 68 | - **TypeScript everywhere**, in strict mode, sharing code through the workspace packages in |