Skip to content

Commit c37b3f7

Browse files
authored
Merge pull request #25 from actions/main
Sync with main
2 parents 26185d4 + 9b45778 commit c37b3f7

File tree

18 files changed

+392
-58
lines changed

18 files changed

+392
-58
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"features": {
55
"ghcr.io/devcontainers/features/docker-in-docker:1": {},
66
"ghcr.io/devcontainers/features/dotnet": {
7-
"version": "8.0.408"
7+
"version": "8.0.410"
88
},
99
"ghcr.io/devcontainers/features/node:1": {
1010
"version": "20"
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: "Docker/Buildx Version Upgrade"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 1' # Run every Monday at midnight
6+
workflow_dispatch: # Allow manual triggering
7+
8+
jobs:
9+
check-versions:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
DOCKER_SHOULD_UPDATE: ${{ steps.check_docker_version.outputs.SHOULD_UPDATE }}
13+
DOCKER_LATEST_VERSION: ${{ steps.check_docker_version.outputs.LATEST_VERSION }}
14+
DOCKER_CURRENT_VERSION: ${{ steps.check_docker_version.outputs.CURRENT_VERSION }}
15+
BUILDX_SHOULD_UPDATE: ${{ steps.check_buildx_version.outputs.SHOULD_UPDATE }}
16+
BUILDX_LATEST_VERSION: ${{ steps.check_buildx_version.outputs.LATEST_VERSION }}
17+
BUILDX_CURRENT_VERSION: ${{ steps.check_buildx_version.outputs.CURRENT_VERSION }}
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Check Docker version
23+
id: check_docker_version
24+
shell: bash
25+
run: |
26+
# Extract current Docker version from Dockerfile
27+
current_version=$(grep "ARG DOCKER_VERSION=" ./images/Dockerfile | cut -d'=' -f2)
28+
29+
# Fetch latest Docker Engine version from Docker's download site
30+
# This gets the latest Linux static binary version which matches what's used in the Dockerfile
31+
latest_version=$(curl -s https://download.docker.com/linux/static/stable/x86_64/ | grep -o 'docker-[0-9]*\.[0-9]*\.[0-9]*\.tgz' | sort -V | tail -n 1 | sed 's/docker-\(.*\)\.tgz/\1/')
32+
33+
# Extra check to ensure we got a valid version
34+
if [[ ! $latest_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
35+
echo "Failed to retrieve a valid Docker version"
36+
exit 1
37+
fi
38+
39+
should_update=0
40+
[ "$current_version" != "$latest_version" ] && should_update=1
41+
42+
echo "CURRENT_VERSION=${current_version}" >> $GITHUB_OUTPUT
43+
echo "LATEST_VERSION=${latest_version}" >> $GITHUB_OUTPUT
44+
echo "SHOULD_UPDATE=${should_update}" >> $GITHUB_OUTPUT
45+
46+
- name: Check Buildx version
47+
id: check_buildx_version
48+
shell: bash
49+
run: |
50+
# Extract current Buildx version from Dockerfile
51+
current_version=$(grep "ARG BUILDX_VERSION=" ./images/Dockerfile | cut -d'=' -f2)
52+
53+
# Fetch latest Buildx version
54+
latest_version=$(curl -s https://api.github.com/repos/docker/buildx/releases/latest | jq -r '.tag_name' | sed 's/^v//')
55+
56+
should_update=0
57+
[ "$current_version" != "$latest_version" ] && should_update=1
58+
59+
echo "CURRENT_VERSION=${current_version}" >> $GITHUB_OUTPUT
60+
echo "LATEST_VERSION=${latest_version}" >> $GITHUB_OUTPUT
61+
echo "SHOULD_UPDATE=${should_update}" >> $GITHUB_OUTPUT
62+
63+
- name: Create annotations for versions
64+
run: |
65+
docker_should_update="${{ steps.check_docker_version.outputs.SHOULD_UPDATE }}"
66+
buildx_should_update="${{ steps.check_buildx_version.outputs.SHOULD_UPDATE }}"
67+
68+
# Show annotation if only Docker needs update
69+
if [[ "$docker_should_update" == "1" && "$buildx_should_update" == "0" ]]; then
70+
echo "::warning ::Docker version (${{ steps.check_docker_version.outputs.LATEST_VERSION }}) needs update but Buildx is current. Only updating when both need updates."
71+
fi
72+
73+
# Show annotation if only Buildx needs update
74+
if [[ "$docker_should_update" == "0" && "$buildx_should_update" == "1" ]]; then
75+
echo "::warning ::Buildx version (${{ steps.check_buildx_version.outputs.LATEST_VERSION }}) needs update but Docker is current. Only updating when both need updates."
76+
fi
77+
78+
# Show annotation when both are current
79+
if [[ "$docker_should_update" == "0" && "$buildx_should_update" == "0" ]]; then
80+
echo "::warning ::Latest Docker version is ${{ steps.check_docker_version.outputs.LATEST_VERSION }} and Buildx version is ${{ steps.check_buildx_version.outputs.LATEST_VERSION }}. No updates needed."
81+
fi
82+
83+
update-versions:
84+
permissions:
85+
pull-requests: write
86+
contents: write
87+
needs: [check-versions]
88+
if: ${{ needs.check-versions.outputs.DOCKER_SHOULD_UPDATE == 1 && needs.check-versions.outputs.BUILDX_SHOULD_UPDATE == 1 }}
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: Checkout repository
92+
uses: actions/checkout@v4
93+
94+
- name: Update Docker version
95+
shell: bash
96+
run: |
97+
latest_version="${{ needs.check-versions.outputs.DOCKER_LATEST_VERSION }}"
98+
current_version="${{ needs.check-versions.outputs.DOCKER_CURRENT_VERSION }}"
99+
100+
# Update version in Dockerfile
101+
sed -i "s/ARG DOCKER_VERSION=$current_version/ARG DOCKER_VERSION=$latest_version/g" ./images/Dockerfile
102+
103+
- name: Update Buildx version
104+
shell: bash
105+
run: |
106+
latest_version="${{ needs.check-versions.outputs.BUILDX_LATEST_VERSION }}"
107+
current_version="${{ needs.check-versions.outputs.BUILDX_CURRENT_VERSION }}"
108+
109+
# Update version in Dockerfile
110+
sed -i "s/ARG BUILDX_VERSION=$current_version/ARG BUILDX_VERSION=$latest_version/g" ./images/Dockerfile
111+
112+
- name: Commit changes and create Pull Request
113+
env:
114+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115+
run: |
116+
# Setup branch and commit information
117+
branch_name="feature/docker-buildx-upgrade"
118+
commit_message="Upgrade Docker to v${{ needs.check-versions.outputs.DOCKER_LATEST_VERSION }} and Buildx to v${{ needs.check-versions.outputs.BUILDX_LATEST_VERSION }}"
119+
pr_title="Update Docker to v${{ needs.check-versions.outputs.DOCKER_LATEST_VERSION }} and Buildx to v${{ needs.check-versions.outputs.BUILDX_LATEST_VERSION }}"
120+
121+
# Configure git
122+
git config --global user.name "github-actions[bot]"
123+
git config --global user.email "<41898282+github-actions[bot]@users.noreply.github.com>"
124+
125+
# Create branch or switch to it if it exists
126+
if git show-ref --quiet refs/remotes/origin/$branch_name; then
127+
git fetch origin
128+
git checkout -B "$branch_name" origin/$branch_name
129+
else
130+
git checkout -b "$branch_name"
131+
fi
132+
133+
# Commit and push changes
134+
git commit -a -m "$commit_message"
135+
git push --force origin "$branch_name"
136+
137+
# Create PR
138+
pr_body="Upgrades Docker version from ${{ needs.check-versions.outputs.DOCKER_CURRENT_VERSION }} to ${{ needs.check-versions.outputs.DOCKER_LATEST_VERSION }} and Docker Buildx version from ${{ needs.check-versions.outputs.BUILDX_CURRENT_VERSION }} to ${{ needs.check-versions.outputs.BUILDX_LATEST_VERSION }}.\n\n"
139+
pr_body+="Release notes: https://docs.docker.com/engine/release-notes/\n\n"
140+
pr_body+="---\n\nAutogenerated by [Docker/Buildx Version Upgrade Workflow](https://github.com/actions/runner/blob/main/.github/workflows/docker-buildx-upgrade.yml)"
141+
142+
gh pr create -B main -H "$branch_name" \
143+
--title "$pr_title" \
144+
--body "$pr_body"

images/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ARG TARGETOS
55
ARG TARGETARCH
66
ARG RUNNER_VERSION
77
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.7.0
8-
ARG DOCKER_VERSION=28.1.1
9-
ARG BUILDX_VERSION=0.23.0
8+
ARG DOCKER_VERSION=28.2.1
9+
ARG BUILDX_VERSION=0.24.0
1010

1111
RUN apt update -y && apt install curl unzip -y
1212

releaseNote.md

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,13 @@
11
## What's Changed
2-
* Increase error body max length before truncation by @ericsciple in https://github.com/actions/runner/pull/3762
3-
* Fix release.yml break by upgrading actions/github-script by @TingluoHuang in https://github.com/actions/runner/pull/3772
4-
* Small runner code cleanup. by @TingluoHuang in https://github.com/actions/runner/pull/3773
5-
* Enable hostcontext to track auth migration. by @TingluoHuang in https://github.com/actions/runner/pull/3776
6-
* Add option in OAuthCred to load authUrlV2. by @TingluoHuang in https://github.com/actions/runner/pull/3777
7-
* Remove create session with broker in MessageListener. by @TingluoHuang in https://github.com/actions/runner/pull/3782
8-
* Enable auth migration based on config refresh. by @TingluoHuang in https://github.com/actions/runner/pull/3786
9-
* Set JWT.alg to PS256 with PssPadding. by @TingluoHuang in https://github.com/actions/runner/pull/3789
10-
* Enable FIPS by default. by @TingluoHuang in https://github.com/actions/runner/pull/3793
11-
* Support auth migration using authUrlV2 in Runner/MessageListener. by @TingluoHuang in https://github.com/actions/runner/pull/3787
12-
* Cleanup feature flag actions_skip_retry_complete_job_upon_known_errors by @ericsciple in https://github.com/actions/runner/pull/3806
13-
* Update dotnet sdk to latest version @8.0.408 by @github-actions in https://github.com/actions/runner/pull/3808
14-
* Bump hook to 0.7.0 by @nikola-jokic in https://github.com/actions/runner/pull/3813
15-
* Allow enable auth migration by default. by @TingluoHuang in https://github.com/actions/runner/pull/3804
16-
* Do not retry /renewjob on 404 by @ericsciple in https://github.com/actions/runner/pull/3828
17-
* Bump Microsoft.NET.Test.Sdk from 17.12.0 to 17.13.0 in /src by @dependabot in https://github.com/actions/runner/pull/3719
18-
* Add copilot-instructions.md by @pje in https://github.com/actions/runner/pull/3810
19-
* Bump actions/upload-release-asset from 1.0.1 to 1.0.2 by @dependabot in https://github.com/actions/runner/pull/3553
20-
* Ignore exception during auth migration. by @TingluoHuang in https://github.com/actions/runner/pull/3835
21-
* feat: default fromPath for problem matchers by @dsanders11 in https://github.com/actions/runner/pull/3802
22-
* Bump Azure.Storage.Blobs from 12.23.0 to 12.24.0 in /src by @dependabot in https://github.com/actions/runner/pull/3837
23-
* Bump nodejs version. by @TingluoHuang in https://github.com/actions/runner/pull/3840
24-
* Feature-flagged support for `JobContext.CheckRunID` by @pje in https://github.com/actions/runner/pull/3811
25-
* Bump System.ServiceProcess.ServiceController from 8.0.0 to 8.0.1 in /src by @dependabot in https://github.com/actions/runner/pull/3844
26-
* Bump xunit.runner.visualstudio from 2.5.8 to 2.8.2 in /src by @dependabot in https://github.com/actions/runner/pull/3845
27-
* Make sure the token's claims are match as expected. by @TingluoHuang in https://github.com/actions/runner/pull/3846
28-
* Prefer _migrated config on startup by @lokesh755 in https://github.com/actions/runner/pull/3853
29-
* Update docker and buildx by @TingluoHuang in https://github.com/actions/runner/pull/3854
30-
31-
## New Contributors
32-
* @dsanders11 made their first contribution in https://github.com/actions/runner/pull/3802
33-
34-
**Full Changelog**: https://github.com/actions/runner/compare/v2.323.0...v2.324.0
2+
* Create schedule workflow to upgrade docker and buildx version. by @TingluoHuang in https://github.com/actions/runner/pull/3859
3+
* Update dotnet sdk to latest version @8.0.409 by @github-actions in https://github.com/actions/runner/pull/3860
4+
* Allow runner to use authv2 during config. by @TingluoHuang in https://github.com/actions/runner/pull/3866
5+
* show helpful error message when resolving actions directly with launch by @aiqiaoy in https://github.com/actions/runner/pull/3874
6+
* Update dotnet sdk to latest version @8.0.410 by @github-actions in https://github.com/actions/runner/pull/3871
7+
* Update Docker to v28.2.1 and Buildx to v0.24.0 by @github-actions in https://github.com/actions/runner/pull/3881
8+
* Allow NO_SSL_VERIFY in RawHttpMessageHandler. by @TingluoHuang in https://github.com/actions/runner/pull/3883
9+
10+
**Full Changelog**: https://github.com/actions/runner/compare/v2.324.0...v2.325.0
3511

3612
_Note: Actions Runner follows a progressive release policy, so the latest release might not be available to your enterprise, organization, or repository yet.
3713
To confirm which version of the Actions Runner you should expect, please view the download instructions for your enterprise, organization, or repository.

src/Runner.Common/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public static class Features
168168
public static readonly string UseContainerPathForTemplate = "DistributedTask.UseContainerPathForTemplate";
169169
public static readonly string AllowRunnerContainerHooks = "DistributedTask.AllowRunnerContainerHooks";
170170
public static readonly string AddCheckRunIdToJobContext = "actions_add_check_run_id_to_job_context";
171+
public static readonly string DisplayHelpfulActionsDownloadErrors = "actions_display_helpful_actions_download_errors";
171172
}
172173

173174
public static readonly string InternalTelemetryIssueDataKey = "_internal_telemetry";

src/Runner.Common/LaunchServer.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface ILaunchServer : IRunnerService
1515
{
1616
void InitializeLaunchClient(Uri uri, string token);
1717

18-
Task<ActionDownloadInfoCollection> ResolveActionsDownloadInfoAsync(Guid planId, Guid jobId, ActionReferenceList actionReferenceList, CancellationToken cancellationToken);
18+
Task<ActionDownloadInfoCollection> ResolveActionsDownloadInfoAsync(Guid planId, Guid jobId, ActionReferenceList actionReferenceList, CancellationToken cancellationToken, bool displayHelpfulActionsDownloadErrors);
1919
}
2020

2121
public sealed class LaunchServer : RunnerService, ILaunchServer
@@ -42,12 +42,16 @@ public void InitializeLaunchClient(Uri uri, string token)
4242
}
4343

4444
public Task<ActionDownloadInfoCollection> ResolveActionsDownloadInfoAsync(Guid planId, Guid jobId, ActionReferenceList actionReferenceList,
45-
CancellationToken cancellationToken)
45+
CancellationToken cancellationToken, bool displayHelpfulActionsDownloadErrors)
4646
{
4747
if (_launchClient != null)
4848
{
49-
return _launchClient.GetResolveActionsDownloadInfoAsync(planId, jobId, actionReferenceList,
50-
cancellationToken: cancellationToken);
49+
if (!displayHelpfulActionsDownloadErrors)
50+
{
51+
return _launchClient.GetResolveActionsDownloadInfoAsync(planId, jobId, actionReferenceList,
52+
cancellationToken: cancellationToken);
53+
}
54+
return _launchClient.GetResolveActionsDownloadInfoAsyncV2(planId, jobId, actionReferenceList, cancellationToken);
5155
}
5256

5357
throw new InvalidOperationException("Launch client is not initialized.");

src/Runner.Listener/Configuration/ConfigurationManager.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public RunnerSettings LoadSettings()
7070
public RunnerSettings LoadMigratedSettings()
7171
{
7272
Trace.Info(nameof(LoadMigratedSettings));
73-
73+
7474
// Check if migrated settings file exists
7575
if (!_store.IsMigratedConfigured())
7676
{
@@ -387,6 +387,14 @@ public async Task ConfigureAsync(CommandSettings command)
387387
},
388388
};
389389

390+
if (agent.Properties.GetValue("EnableAuthMigrationByDefault", false) &&
391+
agent.Properties.TryGetValue<string>("AuthorizationUrlV2", out var authUrlV2) &&
392+
!string.IsNullOrEmpty(authUrlV2))
393+
{
394+
credentialData.Data["enableAuthMigrationByDefault"] = "true";
395+
credentialData.Data["authorizationUrlV2"] = authUrlV2;
396+
}
397+
390398
// Save the negotiated OAuth credential data
391399
_store.SaveCredential(credentialData);
392400
}

src/Runner.Sdk/Util/VssUtil.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static void InitializeVssClientSettings(List<ProductInfoHeaderValue> addi
3838
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
3939
{
4040
VssClientHttpRequestSettings.Default.ServerCertificateValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
41+
RawClientHttpRequestSettings.Default.ServerCertificateValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
4142
}
4243

4344
var rawHeaderValues = new List<ProductInfoHeaderValue>();

src/Runner.Worker/ActionManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@ private async Task BuildActionContainerAsync(IExecutionContext executionContext,
688688
{
689689
if (MessageUtil.IsRunServiceJob(executionContext.Global.Variables.Get(Constants.Variables.System.JobRequestType)))
690690
{
691-
actionDownloadInfos = await launchServer.ResolveActionsDownloadInfoAsync(executionContext.Global.Plan.PlanId, executionContext.Root.Id, new WebApi.ActionReferenceList { Actions = actionReferences }, executionContext.CancellationToken);
691+
var displayHelpfulActionsDownloadErrors = executionContext.Global.Variables.GetBoolean(Constants.Runner.Features.DisplayHelpfulActionsDownloadErrors) ?? false;
692+
actionDownloadInfos = await launchServer.ResolveActionsDownloadInfoAsync(executionContext.Global.Plan.PlanId, executionContext.Root.Id, new WebApi.ActionReferenceList { Actions = actionReferences }, executionContext.CancellationToken, displayHelpfulActionsDownloadErrors);
692693
}
693694
else
694695
{

src/Sdk/Common/Common/RawHttpMessageHandler.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ protected override async Task<HttpResponseMessage> SendAsync(
106106
{
107107
VssTraceActivity traceActivity = VssTraceActivity.Current;
108108

109+
if (!m_appliedServerCertificateValidationCallbackToTransportHandler &&
110+
request.RequestUri.Scheme == "https")
111+
{
112+
HttpClientHandler httpClientHandler = m_transportHandler as HttpClientHandler;
113+
if (httpClientHandler != null &&
114+
this.Settings.ServerCertificateValidationCallback != null)
115+
{
116+
httpClientHandler.ServerCertificateCustomValidationCallback = this.Settings.ServerCertificateValidationCallback;
117+
}
118+
m_appliedServerCertificateValidationCallbackToTransportHandler = true;
119+
}
120+
109121
lock (m_thisLock)
110122
{
111123
// Ensure that we attempt to use the most appropriate authentication mechanism by default.
@@ -291,6 +303,7 @@ private static void ApplySettings(
291303
}
292304
}
293305

306+
private bool m_appliedServerCertificateValidationCallbackToTransportHandler;
294307
private readonly HttpMessageHandler m_transportHandler;
295308
private HttpMessageInvoker m_messageInvoker;
296309
private CredentialWrapper m_credentialWrapper;

0 commit comments

Comments
 (0)