src/aws.js
// User data scripts are run as the root user
User data scripts are run as the root user
User data scripts are run as the root user
function buildUserDataScript(githubRegistrationToken, label) {
  if (config.input.runnerHomeDir) {
    return [
      '#!/bin/bash',
      `cd "${config.input.runnerHomeDir}"`,
      'export RUNNER_ALLOW_RUNASROOT=1',
      'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1',
      `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`,
      './run.sh',
    ];
  } else {
    return [
      '#!/bin/bash',
      'mkdir actions-runner && cd actions-runner',
      '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.280.3/actions-runner-linux-${RUNNER_ARCH}-2.280.3.tar.gz',
      'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.280.3.tar.gz',
      'export RUNNER_ALLOW_RUNASROOT=1',
      'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1',
      `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`,
      './run.sh',
    ];
  }
}
function buildUserDataScript ( githubRegistrationToken , label ) { if ( config . input . runnerHomeDir ) { return [ '#!/bin/bash' , ` ${ config . input . runnerHomeDir } ` , 'export RUNNER_ALLOW_RUNASROOT=1' , 'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1' , ` ${ config . githubContext . owner } ${ config . githubContext . repo } ${ githubRegistrationToken } ${ label } ` , './run.sh' , ] ; } else { return [ '#!/bin/bash' , 'mkdir actions-runner && cd actions-runner' , '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.280.3/actions-runner-linux-${RUNNER_ARCH}-2.280.3.tar.gz' , 'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.280.3.tar.gz' , 'export RUNNER_ALLOW_RUNASROOT=1' , 'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1' , ` ${ config . githubContext . owner } ${ config . githubContext . repo } ${ githubRegistrationToken } ${ label } ` , './run.sh' , ] ; } }
User data scripts are run as the root user
User data scripts are run as the root user
// If runner home directory is specified, we expect the actions-runner software (and dependencies) // to be pre-installed in the AMI, so we simply cd into that directory and then start the runner