Skip to content

Commit 147ad79

Browse files
committed
feat(runner): add support for ephemeral mode
- Introduces ephemeral mode configuration through the `GITHUB_RUNNER_EPHEMERAL` environment variable. - In ephemeral mode, each runner processes only one job before deregistering, providing isolated environments. - Enhances security and supports autoscaling by ensuring no job state or secrets persist between runs. - Updates documentation with usage instructions and environment variable details.
1 parent bae25ce commit 147ad79

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ Both registries receive multi-architecture manifests supporting AMD64 and ARM64.
156156
- `fix: correct installation issue` (patch version bump)
157157
- `feat!: breaking change` or `+semver:major` (major version bump)
158158

159+
### Ephemeral Mode Support
160+
161+
The runner supports ephemeral mode through the `GITHUB_RUNNER_EPHEMERAL` environment variable:
162+
- When set to `"true"`, the runner will be configured with the `--ephemeral` flag
163+
- Each runner will process only one job before automatically deregistering
164+
- This provides clean, isolated environments for each workflow run
165+
- Ideal for autoscaling scenarios and enhanced security requirements
166+
- No job state or secrets persist between runs
167+
159168
### CI/CD Pipeline Details
160169

161170
The pipeline (`pipeline.yaml`) consists of:

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ docker run -d \
7272
emberstack/github-actions-runner:latest
7373
```
7474

75+
#### Ephemeral Mode (Single Job)
76+
```bash
77+
docker run -d \
78+
--name github-runner \
79+
-e GITHUB_RUNNER_URL="https://github.com/your-org/your-repo" \
80+
-e GITHUB_RUNNER_PAT="your-personal-access-token" \
81+
-e GITHUB_RUNNER_EPHEMERAL="true" \
82+
emberstack/github-actions-runner:latest
83+
```
84+
85+
In ephemeral mode, the runner will:
86+
- Process only one job and then automatically deregister
87+
- Provide a clean, isolated environment for each workflow run
88+
- Be ideal for autoscaling scenarios and enhanced security
89+
- Ensure no job state or secrets persist between runs
90+
7591
#### Environment Variables
7692
- `GITHUB_RUNNER_URL` (required): Repository, organization, or enterprise URL
7793
- `GITHUB_RUNNER_PAT` or `GITHUB_RUNNER_TOKEN` (required): Authentication token
@@ -81,6 +97,7 @@ docker run -d \
8197
- `GITHUB_RUNNER_WORKDIR` (optional): Working directory for jobs
8298
- `GITHUB_RUNNER_GID` (optional): Custom GID to create github-actions-runner group
8399
- `GITHUB_RUNNER_DOCKER_SOCK` (optional): Set to "true" to auto-configure Docker socket access
100+
- `GITHUB_RUNNER_EPHEMERAL` (optional): Set to "true" to configure runner in ephemeral mode (single job only)
84101

85102
##### Pre-configured Environment Variables
86103
The following environment variables are set in the Docker image:

src/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ configure_runner() {
113113
CONFIG_CMD="${CONFIG_CMD} --work \"${GITHUB_RUNNER_WORKDIR}\""
114114
fi
115115

116+
# Add ephemeral flag if requested
117+
if [ "${GITHUB_RUNNER_EPHEMERAL}" = "true" ]; then
118+
CONFIG_CMD="${CONFIG_CMD} --ephemeral"
119+
echo "Configuring runner in ephemeral mode (will process only one job)"
120+
fi
121+
116122
# Execute configuration
117123
eval ${CONFIG_CMD}
118124
}

0 commit comments

Comments
 (0)