Skip to content
Discussion options

You must be logged in to vote

Maybe something like this?

const builder = EcsRunnerProvider.imageBuilder(stack, 'builder');
builder.addComponent(
  RunnerImageComponent.environmentVariables({
    ACTIONS_RUNNER_HOOK_JOB_STARTED: '/home/runner/runner-started.sh',
  }),
);
builder.addComponent(
  RunnerImageComponent.custom({
    name: 'runner-started.sh',
    commands: [
      'echo "#!/bin/bash" > /home/runner/runner-started.sh',
      'echo \'curl ${ECS_CONTAINER_METADATA_URI}/task) | jq -r ".Containers[0].Networks[0].IPv4Addresses[0]"\' >> /home/runner/runner-started.sh',
      'echo \'echo https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\' >> /home/runner/runner-started.sh',
      'chmod +x /home/ru…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@nickej
Comment options

@nickej
Comment options

@kichik
Comment options

Answer selected by kichik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants