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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
- name: use-php picks each version
run: |
for v in 8.3 8.4 8.5; do
docker run --rm --entrypoint bash runner-php-smoke:ci -c "id -un | grep -qx runner && RUNNER_TEMP=/tmp use-php $v | grep -q 'PHP $v\.' && composer --version >/dev/null"
docker run --rm --entrypoint bash runner-php-smoke:ci -c "id -un | grep -qx runner && RUNNER_TEMP=/tmp use-php $v | grep -q 'PHP $v\.' && composer --version >/dev/null && gh --version >/dev/null"
done

# Builds the pg target for the default major and for another major with an extension, and runs
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ the major version is 0, a minor release may change configuration (each such chan

## [Unreleased]

### Added
- The GitHub CLI (`gh` 2.102.0, pinned by version and sha256) in every image variant, so a job can open or comment on issues without a GitHub-hosted runner. Nothing is logged in: a job passes `GH_TOKEN`.

### Fixed
- Jobs queued in a run that GitHub reports as `pending` (for example while it waits on a concurrency group) are served; the controller listed only `queued` and `in_progress` runs and left such jobs waiting forever.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ limits. [docs/deploy.md](docs/deploy.md) has the full guide, rollout and rollbac

| Image | Contents |
| --- | --- |
| `ghcr.io/farzai/github-runner-railway:<version>` | the official `actions-runner` (Ubuntu 24.04) plus git, curl, jq, python3, build-essential, shellcheck; no `sudo`, no Docker |
| `ghcr.io/farzai/github-runner-railway:<version>` | the official `actions-runner` (Ubuntu 24.04) plus git, curl, jq, python3, build-essential, shellcheck, gh; no `sudo`, no Docker |
| `ghcr.io/farzai/github-runner-railway:pg-<version>` | the above plus PostgreSQL 18, Playwright's Chromium/WebKit system libraries and browsers (see `image/Dockerfile` for the pinned versions), and `ci-postgres` |
| `ghcr.io/farzai/github-runner-railway:sudo-<version>` | the base image plus passwordless `sudo` for the runner user (opt-in, see below) |
| `ghcr.io/farzai/github-runner-railway:php-<version>` | the base image plus PHP 8.3, 8.4 and 8.5 (ondrej/php PPA) and Composer, and `use-php <version>` to pick one; for PHP projects, since `setup-php` cannot run without sudo |
Expand Down
15 changes: 14 additions & 1 deletion image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ RUN curl -fsSL -o /tmp/shellcheck.tar.xz \
&& install -m 0755 "/tmp/shellcheck-v${SHELLCHECK_VERSION}/shellcheck" /usr/local/bin/shellcheck \
&& rm -rf /tmp/shellcheck.tar.xz "/tmp/shellcheck-v${SHELLCHECK_VERSION}"

# The GitHub CLI, so scripts that open or comment on issues (gh issue create, gh api) run on the pool
# instead of needing a GitHub-hosted runner. Pinned release, verified against the sha256 in the
# release's checksums file (the image is built for linux/amd64). No token is baked in: a job passes
# GH_TOKEN itself.
ARG GH_VERSION=2.102.0
ARG GH_SHA256=bb766f710eef8ede859c18578c72c327597cd4c8a85b06001b1f3843c6019386
RUN curl -fsSL -o /tmp/gh.tar.gz \
"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz" \
&& echo "${GH_SHA256} /tmp/gh.tar.gz" | sha256sum -c - \
&& tar -xzf /tmp/gh.tar.gz -C /tmp \
&& install -m 0755 "/tmp/gh_${GH_VERSION}_linux_amd64/bin/gh" /usr/local/bin/gh \
&& rm -rf /tmp/gh.tar.gz "/tmp/gh_${GH_VERSION}_linux_amd64"

# A job must not be able to become root or write the runner's own files as root.
RUN (deluser runner sudo || true) \
&& (deluser runner docker || true) \
Expand All @@ -32,7 +45,7 @@ RUN (deluser runner sudo || true) \
# The build fails here, not at the first job, if any of that did not take.
RUN ! id -nG runner | tr ' ' '\n' | grep -qxE 'sudo|docker|root' \
&& ! grep -rqs NOPASSWD /etc/sudoers /etc/sudoers.d \
&& for t in git curl jq unzip python3 gcc make shellcheck; do command -v "$t" >/dev/null || { echo "missing $t" >&2; exit 1; }; done
&& for t in git curl jq unzip python3 gcc make shellcheck gh; do command -v "$t" >/dev/null || { echo "missing $t" >&2; exit 1; }; done

COPY entrypoint.sh /entrypoint.sh
RUN chmod 0755 /entrypoint.sh
Expand Down
Loading