Skip to content

Commit

Permalink
Allow to optionally skip self-update
Browse files Browse the repository at this point in the history
When using infrastructure as code, containers and recipes, pinning
versions for reproducibility is a good practice. Usually docker
container images contain static tools and binaries and the docker image
is tagged with a specific version.

Constructing a docker image of a runner with a specific runner version
and then self-updating itself doesn't seem that natural, instead the
docker image should use whatever that binary was built/tagged to.

Additionally to this - this concept doesn't play well when using
ephemeral runners and kuberentes. First of all, we need to pay the price
of downloading/self-updating every single ephemeral pod for every single
job which causes delays in execution. Secondly this doesn't work well
and containers may get stuck

Related issues that will be solved with this:
- actions#1396
- actions#246
- actions#485
- actions#422
- actions#442
  • Loading branch information
fgalind1 committed Oct 28, 2021
1 parent 854d5e3 commit 05f2765
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Runner.Listener/SelfUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public async Task<bool> SelfUpdate(AgentRefreshMessage updateMessage, IJobDispat
return false;
}

if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_SKIP_SELF_UPDATE")))
{
Trace.Info($"An update is available, but it was chosen to skip the self-update.");
return false;
}

Trace.Info($"An update is available.");

// Print console line that warn user not shutdown runner.
Expand Down

0 comments on commit 05f2765

Please sign in to comment.