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
3 changes: 2 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ env:
es6: true
node: true
jest: true
es2020: true
extends:
- eslint:recommended
parserOptions:
ecmaVersion: 2018
ecmaVersion: 2020
sourceType: module
rules:
no-use-before-define: error
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dist/index.js: $(wildcard src/*.js)
npm run package

docker-build:
docker run --rm -ti -v "$(PWD):/src" node:16 bash -c "cd src && npm install && make"

docker-lint:
docker run --rm -ti -v "$(PWD):/src" node:16 bash -c "cd src && npm install && npm run lint"

.PHONY: docker-build
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,14 @@ Check the [internal docs](https://docs.shiphero.xyz/ci.html#horizontally-scaled-
- [Avoid failures when other runners are already registered with same name](https://github.com/Shiphero/ec2-github-runner/pull/4) by assigning a random name to the instances.

- [Support for using spot instances](https://github.com/machulav/ec2-github-runner/pull/171)

## Build
```sh
make docker-build
```

Or using node 16:
```sh
npm install
make
```
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65286,8 +65286,9 @@ function buildUserDataScript(githubRegistrationToken, label) {
`echo "${config.input.preRunnerScript}" > pre-runner-script.sh`,
'source pre-runner-script.sh',
'case $(uname -m) in aarch64) ARCH="arm64" ;; amd64|x86_64) ARCH="x64" ;; esac && export RUNNER_ARCH=${ARCH}',
'curl -O -L https://github.com/actions/runner/releases/download/v2.313.0/actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz',
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz',
"VERSION=$(curl -s https://api.github.com/repos/actions/runner/releases/latest | grep tag_name | grep -oP '\\d+(\\.\\d+)*')",
'curl -O -L https://github.com/actions/runner/releases/download/v${VERSION}/actions-runner-linux-${RUNNER_ARCH}-${VERSION}.tar.gz',
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-${VERSION}.tar.gz',
'export RUNNER_ALLOW_RUNASROOT=1',
`./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name $(hostname)-$(uuidgen)`,
'./run.sh',
Expand Down
5 changes: 3 additions & 2 deletions src/aws.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ function buildUserDataScript(githubRegistrationToken, label) {
`echo "${config.input.preRunnerScript}" > pre-runner-script.sh`,
'source pre-runner-script.sh',
'case $(uname -m) in aarch64) ARCH="arm64" ;; amd64|x86_64) ARCH="x64" ;; esac && export RUNNER_ARCH=${ARCH}',
'curl -O -L https://github.com/actions/runner/releases/download/v2.313.0/actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz',
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz',
"VERSION=$(curl -s https://api.github.com/repos/actions/runner/releases/latest | grep tag_name | grep -oP '\\d+(\\.\\d+)*')",
'curl -O -L https://github.com/actions/runner/releases/download/v${VERSION}/actions-runner-linux-${RUNNER_ARCH}-${VERSION}.tar.gz',
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-${VERSION}.tar.gz',
'export RUNNER_ALLOW_RUNASROOT=1',
`./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name $(hostname)-$(uuidgen)`,
'./run.sh',
Expand Down