You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
## Heroku-hosted runner for GitHub Actions
2
2
3
-
This project defines a `Dockerfile` to run a custom Heroku-hosted runner for Github Actions (see also [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners)).
3
+
This project defines a `Dockerfile`/`CNB` to build and run a custom Heroku-hosted runner for Github Actions (see also [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners)).
4
4
5
-
The runner is hosted on [Heroku as a docker image](https://devcenter.heroku.com/articles/build-docker-images-heroku-yml) via `heroku.yml`.
5
+
The runner is hosted on Heroku as a [docker image](https://devcenter.heroku.com/articles/build-docker-images-heroku-yml) via `heroku.yml` or [OCI image](https://devcenter.heroku.com/articles/buildpacks#cloud-native-buildpacks) via `project.toml`.
6
6
7
7
## How it works
8
8
@@ -102,7 +102,7 @@ This project includes a workflow that can be run manually or automatically sched
102
102
103
103
To take advantage of the above automation you need to [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) or [mirror](https://docs.github.com/en/repositories/creating-and-managing-repositories/duplicating-a-repository#mirroring-a-repository-in-another-location) this repository to your private organisation's repository and enable workflows run.
104
104
105
-
If you need to implement version pinning to avoid potential supply chain vulnerabilities, it's possible to configure a specific runner version (see `RUNNER_VERSION`in heroku.yml). In this case you'll have to modify manually the version and run the above mentioned workflow manually and the scheduled workflow execution can be disabled.
105
+
If you need to implement version pinning to avoid potential supply chain vulnerabilities, it's possible to configure a specific runner version (see `RUNNER_VERSION`in heroku.yml/project.toml). In this case you'll have to modify manually the version and run the above mentioned workflow manually and the scheduled workflow execution can be disabled.
106
106
107
107
Whenever the runner package is downloaded (either the latest or a specific version) the SHA256 checksum is verified, if the computed checksum does not match with the expected one the build fails.
108
108
@@ -112,10 +112,11 @@ This new release:
112
112
- Uses ephemeral compute to allow [autoscaling](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling) and [hardening](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#hardening-for-self-hosted-runners) of self-hosted runners. Ephemeral runners are short-lived containers that are executed only once for a single job, providing isolated environments to reduce the risk of data leakage
113
113
- Uses a [base image](https://devcenter.heroku.com/articles/stack) that is curated and maintained by Heroku
114
114
- Logs the self-runner name to manage it from the GitHub dashboard
115
-
- Reduces the Docker image footprint and it's possible to run it as one-off dyn
115
+
- Reduces the Docker/OCI image footprint and it's possible to run it as one-off dyno (Cedar only)
116
116
- Includes all the recent GitHub self-hosted runners features (e.g. labels, groups, ...) and streamlines the configuration and setup
117
-
- Integrates the [Heroku Button](https://www.heroku.com/elements/buttons) to install the runner in one-click
117
+
- Integrates the [Heroku Button](https://www.heroku.com/elements/buttons) to install the runner in one-click (Cedar only)
118
118
- Supports fine-grained GitHub tokens for granular permission control
119
+
- Can be executed on both Heroku Cedar and Heroku Next Generation Platform Fir
119
120
120
121
## Security Notes and Recommendations
121
122
Below are summarised some general recommendations to improve security for using GitHub Actions and self-hosted runners, for a complete guide and further details please refer to [Security hardening for GitHub Actions](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions):
@@ -155,7 +156,6 @@ Below are summarised some general recommendations to improve security for using
155
156
## Limits and Considerations
156
157
- As the runner image is not based on the [standard GitHub dockerfile](https://github.com/actions/runner/blob/main/images/Dockerfile) then some Actions might not work as expected
157
158
- Currently, it's not possible to run GitHub Actions requiring docker/rootless-docker as they need higher privileges that are not allowed on Heroku dynos for security reasons
158
-
- The runner cannot be executed on [Fir](https://devcenter.heroku.com/changelog-items/3071) yet, requiring an ARM based image
# HIDDEN_ENV_VARS must only contain a list of space separated Heroku env vars. Those can contain uppercase letters (A-Z), numbers (0-9), underscores (_)
@@ -80,11 +81,19 @@ detachRunner() {
80
81
--token "${GITHUB_REG_TOKEN}"
81
82
}
82
83
83
-
# Recall that this script is running in our dockerized image on Heroku.
84
-
# Our Dockerfile created a user named 'docker' and the following directory is
85
-
# where it installed the GitHub Actions self-hosting runner package.
86
-
# We now navigate to that directory to start the runner.
87
-
cd"${HOME}"/actions-runner || { echo"error while changing directory to ${HOME}/actions-runner";exit 1; }
84
+
# Directory selection logic
85
+
# If the installation was done in the Dockerfile, use the Dockerfile path
86
+
# Otherwise, default to CNB path that is in the current working directory
87
+
if [[ -d"${HOME}/actions-runner" ]];then
88
+
RUNNER_DIR="${HOME}/actions-runner"
89
+
elif [[ -d"${PWD}/actions-runner" ]];then
90
+
RUNNER_DIR="${PWD}/actions-runner"
91
+
else
92
+
echo"Could not determine runner directory. Neither CNB nor Dockerfile path exists.">&2
93
+
exit 1
94
+
fi
95
+
96
+
cd"$RUNNER_DIR"|| { echo"error while changing directory to $RUNNER_DIR";exit 1; }
0 commit comments