github runs-on/runs-on v2.6.2

latest release: v2.6.3
pre-release12 days ago

Magic transparent cache for dependencies and docker layers. SSM support for logging into runner instances. And more.

What's changed

jobs:
  look-ma-no-cache-config:
    runs-on: "runs-on=${{github.run_id}}/runner=2cpu-linux-x64/extras=s3-cache"
    steps:
     # standard action is supported, no need to use `runs-on/cache@v4`
     - uses: actions/cache@v4
       with:
         path: my-path
         key: my-key
     # third-party actions that depend on official toolkit (99%) are supported as well
     - uses: ruby/setup-ruby@v1
       with:
         bundler-cache: true
  • BETA - Transparent S3-backed caching for Docker layers when using cache-to: type=gha / cache-from: type=gha. For now, the magic caching is only enabled with the extras=s3-cache job label.
jobs:
  look-ma-no-cache-config:
    runs-on: "runs-on=${{github.run_id}}/runner=2cpu-linux-x64/extras=s3-cache"
      # BEFORE
      - name: "Build and push image (explicit s3 config)"
        uses: docker/build-push-action@v4
        with:
          tags: test
          cache-from: type=s3,blobs_prefix=cache/docker-s3/,manifests_prefix=cache/docker-s3/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }}
          cache-to: type=s3,blobs_prefix=cache/docker-s3/,manifests_prefix=cache/docker-s3/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max

      # AFTER
      - name: "Build and push image (type=gha, automgically switched to S3)"
        uses: docker/build-push-action@v4
        with:
          tags: test
          cache-from: type=gha
          cache-to: type=gha,mode=max
  • Assign AmazonSSMManagedInstanceCore policy to EC2 instances, so that one can easily connect to the runner instance with SSM. Fixes #129.
AWS_PROFILE=YOUR_PROFILE aws ssm start-session --target INSTANCE_ID --reason "testing ssm"
  • Allow to inject additional environment variables from the preinstall step, by exposing a $GITHUB_ENV variable that you can write to. The variables will automatically be made available to the job steps. Fixes #188.
runners:
  preinstall-with-env:
    image: ubuntu22-full-arm64
    family: ["c7g"]
    preinstall: |
      echo "Adding a custom env var..."
      echo "MY_CUSTOM_VAR=my_custom_value" >> $GITHUB_ENV
  • Support preinstall for Windows runners.

  • Expose RunsOnServiceArn as output, so that one can use it to build the CloudWatch log paths. Fixes #184.

  • Do not send the cost allocation tag warning if the latest cost report was non-zero. Fixes #187.

  • Add Ec2LogRetentionInDays stack parameter. Fixes #189.

  • Allow to read license key from SSM. Fixes #176.

image

Upgrade

Don't miss a new runs-on release

NewReleases is sending notifications on new releases.