Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
dd478fc
[release/10.0] Make some rpm classes public (#16084)
github-actions[bot] Aug 27, 2025
7d2c2bb
[release/10.0] Fix pipeline triggers for release/10.0 (#16090)
akoeplinger Aug 28, 2025
f635c94
[release/10.0] Source code updates from dotnet/dotnet (#16096)
dotnet-maestro[bot] Sep 2, 2025
a65f3a2
[release/10.0] Update dependencies from dotnet/arcade (#16097)
dotnet-maestro[bot] Sep 2, 2025
a9acfdf
[release/10.0] Update dependencies from dotnet/arcade (#16098)
dotnet-maestro[bot] Sep 4, 2025
c831777
Set RestoreEnablePackagePruning default in props (#16104)
ViktorHofer Sep 4, 2025
c4b67c6
[release/10.0] Source code updates from dotnet/dotnet (#16109)
dotnet-maestro[bot] Sep 5, 2025
80961db
[release/10.0] Update dependencies from dotnet/arcade (#16107)
dotnet-maestro[bot] Sep 7, 2025
31e6bc1
[release/10.0] Update dependencies from dotnet/arcade (#16112)
dotnet-maestro[bot] Sep 8, 2025
cf230f8
[release/10.0] Update dependencies from dotnet/arcade (#16115)
dotnet-maestro[bot] Sep 9, 2025
fff7a81
[release/10.0] Support internal feeds for .NET 10 (#16125)
github-actions[bot] Sep 10, 2025
de1b347
Allows you to set the OfficialBuildId for the publish build assets job.
MiYanni Sep 9, 2025
bffa62d
Default the OfficialBuildId variable on the publish build assets temp…
MiYanni Sep 9, 2025
8f32ab6
Removed redundant defaulting logic for officialBuildId.
MiYanni Sep 11, 2025
c8a5580
[release/10.0] Make OfficialBuildId settable on publish assets (#16131)
MiYanni Sep 12, 2025
2ee9fba
[release/10.0] Source code updates from dotnet/dotnet (#16142)
dotnet-maestro[bot] Sep 17, 2025
d81f58d
[release/10.0] Strong name sign `Microsoft.DotNet.Build.Tasks.Feed.dl…
ellahathaway Sep 17, 2025
6561b93
[release/10.0] Always use x86 burn for bundle (#16150) (#16151)
PranavSenthilnathan Sep 18, 2025
34addda
[release/10.0] Add back license for MSI installers (#16093) (#16153)
PranavSenthilnathan Sep 19, 2025
6275af4
[release/10.0] Update dependencies from dotnet/arcade (#16123)
dotnet-maestro[bot] Sep 19, 2025
81a615d
Use dotnet-public feed for downloading NuGet.VerifyMicrosoftPackage (…
JoeRobich Sep 25, 2025
a4c9a07
[release/10.0] Update dependencies from dotnet/arcade (#16155)
dotnet-maestro[bot] Sep 26, 2025
e6f510c
[release/10.0] Build duplicates of all installer packages for new sig…
github-actions[bot] Sep 29, 2025
4eaa220
[release/10.0] Drop swidtag in correct Program Files folder per-arch …
wtgodbe Oct 7, 2025
33ebf26
[release/10.0] Update dependencies from dotnet/arcade (#16168)
dotnet-maestro[bot] Oct 8, 2025
7ff6478
[release/10.0] Enable generic detached signature support in SignTool …
github-actions[bot] Oct 8, 2025
32a401a
[release/10.0] Update SetupNugetSource.ps1/sh with new functionality …
github-actions[bot] Oct 9, 2025
ba45f22
[release/10.0] Source code updates from dotnet/dotnet (#16202)
dotnet-maestro[bot] Oct 10, 2025
ee88ece
[release/10.0] Source code updates from dotnet/dotnet (#16208)
dotnet-maestro[bot] Oct 13, 2025
e8ca693
[release/10.0] Fix SetupNugetSources.sh to avoid creating invalid XML…
github-actions[bot] Oct 13, 2025
c90342f
[release/10.0] Source code updates from dotnet/dotnet (#16227)
dotnet-maestro[bot] Oct 20, 2025
aa655f2
[release/10.0] PublishBuildToMaestro should have minimum retry delay …
github-actions[bot] Oct 20, 2025
63eed29
[release/10.0] Add a second .NET path for MicroBuild (#16238)
github-actions[bot] Oct 22, 2025
fb1799f
Add support for dotnet-eng-internal and dotnet-tools-internal feeds i…
Copilot Oct 31, 2025
c982c6f
[release/10.0] Install .NET 8 before running Publish Using Darc (#16264)
dkurepa Nov 4, 2025
987d1a7
[release/10.0] Enhance logging for file extraction and repackaging wi…
hoyosjs Nov 5, 2025
412dad5
[release/10.0] Allow use of internal sdk (#16267)
rmarinho Nov 6, 2025
695d0f1
[release/10.0] Reduce the paths that binskim scans (#16289)
github-actions[bot] Nov 12, 2025
27004a1
Update .NET SDK version to 10.0.100 (#16286)
mmitche Nov 12, 2025
b0cc10a
Port fail open CRL fixes to 10.0 (#16299)
ericstj Nov 13, 2025
a3c3502
Fix duplicated variables in publish-build-assets.yml (#16327)
akoeplinger Nov 19, 2025
71e05cb
[release/10.0] Update Microsoft.NET.Test.Sdk to 18.0.1 (#16321)
premun Nov 19, 2025
3992c10
[release/10.0] Source code updates from dotnet/dotnet (#16325)
dotnet-maestro[bot] Nov 21, 2025
204a301
Revert "[release/10.0] Add a second .NET path for MicroBuild" (#16308)
ellahathaway Nov 21, 2025
eb29fba
[release/10.0] Install MicroBuild in temporary directory (#16307) (#1…
ellahathaway Nov 24, 2025
f1d31d0
[release/10.0] Update dependencies from dotnet/xharness (#16346)
dotnet-maestro[bot] Nov 24, 2025
b94b1e6
[release/10.0] Use CDN URL instead of blob in FindDotNetCliPackage (#…
github-actions[bot] Nov 24, 2025
2daeb3e
[release/10.0] Remove audit sources from NuGet.config (#16357)
github-actions[bot] Nov 26, 2025
19e800e
[release/10.0] Source code updates from dotnet/dotnet (#16356)
dotnet-maestro[bot] Nov 27, 2025
c6fd10d
[release/10.0] Update dependencies from dotnet/xharness (#16363)
dotnet-maestro[bot] Dec 1, 2025
93816e2
[release/10.0] Update Windows pool images from VS2022 to VS2026 Previ…
akoeplinger Dec 2, 2025
93a17c7
[release/10.0] Add detached signature CertificatesSignInfo (#16372)
github-actions[bot] Dec 3, 2025
8c241e8
[release/10.0] Move to 18.0.0 xcopy msbuild (#16373)
mmitche Dec 4, 2025
774a2ef
[release/10.0] Only run source index for main builds (#16378)
github-actions[bot] Dec 6, 2025
6605fb5
[release/10.0] Update dependencies from dotnet/xharness (#16383)
dotnet-maestro[bot] Dec 8, 2025
8d3de8e
[release/10.0] Update dependencies from dotnet/arcade (#16389)
dotnet-maestro[bot] Dec 9, 2025
9f286dd
[release/10.0] Always pass -UseBasicParsing for Invoke-WebRequest cal…
akoeplinger Dec 11, 2025
cae95dc
[release/10.0] Source code updates from dotnet/dotnet (#16400)
dotnet-maestro[bot] Dec 12, 2025
676d6a2
Refactor vsRequirements assignment logic in tools.ps1
marcpopMSFT Nov 14, 2025
5563198
[release/10.0] Enable tools.ps1 find VS logic to work even if VS is n…
nagilson Dec 12, 2025
b451a05
[release/10.0] Source code updates from dotnet/dotnet (#16411)
dotnet-maestro[bot] Dec 26, 2025
d8dca0b
[release/10.0] Update dependencies from dotnet/arcade (#16414)
dotnet-maestro[bot] Dec 26, 2025
a3f5c45
[release/10.0] Update dependencies from dotnet/arcade (#16426)
dotnet-maestro[bot] Jan 5, 2026
13323fc
[release/10.0] Add DoNotUnpack flag to sign containers without extrac…
github-actions[bot] Jan 7, 2026
9f518f2
[release/10.0] Use VS 2022 images in Arcade & Publishing infra (#16439)
premun Jan 12, 2026
af17297
Update image in source-build.yml for Linux pool (#16463)
MichaelSimons Jan 16, 2026
bf2212b
[release/10.0] Use Azure-Linux-3-Amd64 for SB (#16459)
mmitche Jan 22, 2026
c53d03a
[release/10.0] Use AzureLinux3 image for source-build.yml (#16477)
akoeplinger Jan 26, 2026
f33d1fd
[release/10.0] Fix reading container contents when DoNotUnpack is set…
github-actions[bot] Jan 28, 2026
eaf1171
[release/10.0] Add LinuxSign500180PGP cert (#16482)
github-actions[bot] Jan 28, 2026
e316e02
[release/10.0] Allow overwriting detached signature (#16490)
github-actions[bot] Jan 31, 2026
b0f891c
[release/10.0] Add DO-NOT-UNPACK support to SignCheck (#16489)
github-actions[bot] Jan 31, 2026
eb5b60b
[release/10.0] Update dependencies from dotnet/arcade (#16492)
dotnet-maestro[bot] Feb 4, 2026
c45c9fb
[release/10.0] Enable Permissive, CFSClean policies (#16430) (#16496)
mmitche Feb 4, 2026
58d7536
[release/10.0] Use correct name for the AZL3 build image (#16511)
github-actions[bot] Feb 6, 2026
4bf37ce
[release/10.0] Update dependencies from dotnet/xharness (#16423)
dotnet-maestro[bot] Feb 10, 2026
eae2786
[release/10.0] Support for hotfix version tag (#16531)
github-actions[bot] Feb 18, 2026
2d52564
[main] Source code updates from dotnet/dotnet (#16533)
dotnet-maestro[bot] Feb 19, 2026
062ea8a
[release/10.0] Source code updates from dotnet/dotnet (cherry-pick of…
JanProvaznik Feb 19, 2026
4d89865
[release/10.0] Update dependencies from dotnet/xharness (#16542)
dotnet-maestro[bot] Feb 23, 2026
bea9ad3
[release/10.0] Update dependencies from dotnet/arcade (#16550)
dotnet-maestro[bot] Mar 2, 2026
5976b9d
Remove MaestroAccessToken from publish logs YAML (#16557)
jjonescz Mar 3, 2026
6f1da2a
[release/10.0] Source code updates from dotnet/dotnet (#16556)
dotnet-maestro[bot] Mar 9, 2026
8b0ca8d
[release/10.0] Source code updates from dotnet/dotnet (#16576)
dotnet-maestro[bot] Mar 10, 2026
b4f8503
[release/10.0] Source code updates from dotnet/dotnet (#16583)
dotnet-maestro[bot] Mar 13, 2026
e365cfc
[release/10.0] Add automatic retry for notarization failures in SignT…
github-actions[bot] Mar 14, 2026
3907f62
[release/10.0] Source code updates from dotnet/dotnet (#16600)
dotnet-maestro[bot] Mar 18, 2026
8f7569a
[release/10.0] Fix incorrect "NOT ... OR ..." pattern in LoadExclusio…
github-actions[bot] Mar 27, 2026
52b0397
[release/10.0] Use dnceng build pool instead of hosted pool in azure-…
github-actions[bot] Mar 27, 2026
7a177ed
[release/10.0] Update dependencies from dotnet/xharness (#16590)
dotnet-maestro[bot] Mar 27, 2026
62dc2de
[release/10.0] Update build images to VS 2026 (#16635)
akoeplinger Mar 27, 2026
2ad6e0a
[release/10.0] Update dependencies from dotnet/arcade (#16654)
dotnet-maestro[bot] Apr 1, 2026
9cc200f
Switch enablePublishBuildArtifacts to use pipeline artifacts (#16630)
Copilot Mar 27, 2026
c269587
Migrate from PublishBuildArtifacts to PublishPipelineArtifact (#16638)
mmitche Mar 30, 2026
aa21b5f
Fix ReleaseConfigs download path after pipeline artifacts migration (…
mmitche Mar 31, 2026
4c3e42c
Move to v4 publishing. (#16639)
mmitche Mar 31, 2026
3c7af9b
Remove SourceLink validation from post-build pipeline (#16648)
akoeplinger Mar 31, 2026
c198583
Set isProduction: false for logs in 1ES PT and remove SBOM/CG (#16649)
akoeplinger Mar 31, 2026
a5f0eb9
Fix PostBuildLogs artifact name collision across jobs (#16651)
mmitche Mar 31, 2026
54b2ce2
Add enablePublishing parameter to opt out of V4 artifact publishing (…
mmitche Apr 2, 2026
57e4e77
Unblock publish (#16676)
hoyosjs Apr 3, 2026
1ad1384
Enable V4 publishing for Windows_NT official job (#16674)
mmitche Apr 3, 2026
c4cbe74
Mark publishing artifacts as non-production and fix boolean property …
akoeplinger Apr 3, 2026
22deca3
Backport v4 publishing changes to release/10.0
Copilot Apr 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .azuredevops/dependabot.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"microsoft.dnceng.secretmanager": {
"version": "1.1.0-beta.26176.1",
"version": "1.1.0-beta.25421.1",
"commands": [
"secret-manager"
]
Expand Down
6 changes: 0 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,3 @@ compat text eol=lf
# not treat as generated
###############################################################################
**/build/** linguist-generated=false

###############################################################################
# Set file behavior to:
# treat as JSONC (JSON with Comments) for GitHub syntax highlighting
###############################################################################
*.json linguist-language=JSONC
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ timeout 6000 ./build.sh --restore --build --configuration Release --test
4. Validate packaging via: `./build.sh --pack --configuration Release`

### Helix Test Development
1. Create test projects targeting `$(BundledNETCoreAppTargetFramework)` framework
1. Create test projects targeting `$(NetToolCurrent)` framework
2. Configure in `tests/UnitTests.proj` for Helix execution
3. Use XUnit with `Microsoft.DotNet.XUnitExtensions` for enhanced capabilities
4. Test timeout default: 300 seconds (override with XUnitWorkitemTimeout)
Expand Down
151 changes: 32 additions & 119 deletions .github/workflows/backport-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,11 @@ on:
Backport of #%source_pr_number% to %target_branch%

/cc %cc_users%
pr_labels:
description: 'A comma-separated list of labels to add when the backport pull request is created.'
required: false
type: string
default: ''
repository_owners:
description: 'A comma-separated list of repository owners where the workflow will run. Defaults to "dotnet,microsoft".'
required: false
type: string
default: 'dotnet,microsoft'
additional_git_am_switches:
description: 'Additional switches to pass to git am command (e.g., "--exclude=docs/release-notes/* --whitespace=fix"). Useful for excluding files that differ between branches or fixing whitespace conflicts.'
required: false
type: string
default: ''
conflict_resolution_command:
description: >-
Optional shell command to attempt automatic conflict resolution after a failed git am.
If the command eliminates merge conflicts, the backport proceeds automatically.
Do not run git commands from this parameter as they might have unintended side effects.
DO NOT PASS UNTRUSTED INPUT TO THIS PARAMETER.
required: false
type: string

jobs:
cleanup:
Expand Down Expand Up @@ -82,8 +64,7 @@ jobs:
with:
script: |
const target_branch = '${{ steps.target-branch-extractor.outputs.result }}';
const workflow_run_url = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const backport_start_body = `Started backporting to \`${target_branch}\` ([link to workflow run](${workflow_run_url}))`;
const backport_start_body = `Started backporting to _${target_branch}_: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
Expand All @@ -97,53 +78,28 @@ jobs:
- name: Run backport
uses: actions/github-script@v7
env:
GH_TOKEN: ${{ github.token }}
BACKPORT_PR_TITLE_TEMPLATE: ${{ inputs.pr_title_template }}
BACKPORT_PR_DESCRIPTION_TEMPLATE: ${{ inputs.pr_description_template }}
BACKPORT_PR_LABELS: ${{ inputs.pr_labels }}
ADDITIONAL_GIT_AM_SWITCHES: ${{ inputs.additional_git_am_switches }}
CONFLICT_RESOLUTION_COMMAND: ${{ inputs.conflict_resolution_command }}
with:
script: |
const target_branch = '${{ steps.target-branch-extractor.outputs.result }}';
const repo_owner = context.payload.repository.owner.login;
const repo_name = context.payload.repository.name;
const pr_number = context.payload.issue.number;
const comment_user = context.payload.comment.user.login;
const workflow_run_url = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;

const wrap_in_code_block = (language, content) => `\`\`\`${language}\n${content}\n\`\`\``;
const wrap_in_details_block = (summary, content) => `<details>\n<summary>${summary}</summary>\n\n${content}\n</details>`;

// Post a comment on the PR and return the comment URL
async function postComment(body) {
const { data: comment } = await github.rest.issues.createComment({
owner: repo_owner,
repo: repo_name,
issue_number: pr_number,
body
});
return comment.html_url;
}

try {
// verify the comment user has write access to the repo
// verify the comment user is a repo collaborator
try {
const { data: permission } = await github.rest.repos.getCollaboratorPermissionLevel({
await github.rest.repos.checkCollaborator({
owner: repo_owner,
repo: repo_name,
username: comment_user
});

const writePermissions = ['admin', 'write'];
if (!writePermissions.includes(permission.permission)) {
throw new Error(`Insufficient permissions: ${permission.permission}`);
}

console.log(`Verified ${comment_user} has ${permission.permission} access to the repo.`);
console.log(`Verified ${comment_user} is a repo collaborator.`);
} catch (error) {
console.log(error);
throw new Error(`Error: @${comment_user} does not have write access to this repo, backporting is not allowed. Required permissions: write or admin.`);
throw new Error(`Error: @${comment_user} is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your ${repo_owner} team membership visibility is set to Public on https://github.com/orgs/${repo_owner}/people?query=${comment_user}`);
}

try { await exec.exec(`git ls-remote --exit-code --heads origin ${target_branch}`) } catch { throw new Error(`Error: The specified backport target branch "${target_branch}" wasn't found in the repo.`); }
Expand Down Expand Up @@ -171,14 +127,9 @@ jobs:
} catch { }

// download and apply patch
const patch_file = 'changes.patch';
await exec.exec(`bash -c "gh pr diff --patch ${pr_number} > ${patch_file}"`);
await exec.exec(`curl -sSL "${context.payload.issue.pull_request.patch_url}" --output changes.patch`);

const additional_switches = process.env.ADDITIONAL_GIT_AM_SWITCHES?.trim() || '';
const base_switches = '--3way --empty=keep --ignore-whitespace --keep-non-patch';
const git_am_command = additional_switches
? `git am ${base_switches} ${additional_switches} ${patch_file}`
: `git am ${base_switches} ${patch_file}`;
const git_am_command = "git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch";
let git_am_output = `$ ${git_am_command}\n\n`;
let git_am_failed = false;
try {
Expand All @@ -194,51 +145,20 @@ jobs:
}

if (git_am_failed) {
const resolution_command = process.env.CONFLICT_RESOLUTION_COMMAND || '';

// If no resolution command supplied, fail immediately
if (resolution_command.trim().length === 0) {
const details = `${wrap_in_code_block('console', git_am_output)}\n[Link to workflow output](${workflow_run_url})`;
const git_am_failed_body = `@${comment_user} backporting to \`${target_branch}\` failed, the patch most likely resulted in conflicts. Please backport manually!\n${wrap_in_details_block('git am output', details)}`;
postComment(git_am_failed_body);
core.setFailed("git am failed, most likely due to a merge conflict.");
return;
}

console.log(`git am failed; attempting in-session conflict resolution via provided command: ${resolution_command}`);

// Run user-provided resolution command
// Ignore return code to capture stdout/stderr
const resolution_result = await exec.getExecOutput(`bash -c "${resolution_command}"`, [], { ignoreReturnCode: true });
if (resolution_result.exitCode !== 0) {
const details = `\`${resolution_command}\` stderr:\n${wrap_in_code_block('console', resolution_result.stderr)}\n[Link to workflow output](${workflow_run_url})`;
const resolution_failed_body = `@${comment_user} backporting to \`${target_branch}\` failed during automated conflict resolution. Please backport manually!\n${wrap_in_details_block('Error details', details)}`;
postComment(resolution_failed_body);
core.setFailed(`Automated conflict resolution command exited with code ${resolution_result.exitCode}`);
return;
}

// Stage changes (excluding patch file)
await exec.exec(`git add -A`);
await exec.exec(`git reset HEAD ${patch_file}`);

// Check for remaining conflicts
const diff_command = 'git diff --name-only --diff-filter=U';
const diff_result = await exec.getExecOutput(diff_command);
if (diff_result.stdout.trim().length !== 0) {
const details = `${wrap_in_code_block('console', diff_result.stdout)}\n[Link to workflow output](${workflow_run_url})`;
const conflicts_body = `@${comment_user} backporting to \`${target_branch}\` failed. Automated conflict resolution did not resolve all conflicts. Please backport manually!\n${wrap_in_details_block(`${diff_command} output`, details)}`;
postComment(conflicts_body);
core.setFailed(`Automated conflict resolution did not resolve all conflicts.`);
return;
}

console.log('Automated conflict resolution resolved all merge conflicts. Continuing.');
await exec.exec('git am --continue');
const git_am_failed_body = `@${context.payload.comment.user.login} backporting to "${target_branch}" failed, the patch most likely resulted in conflicts:\n\n\`\`\`shell\n${git_am_output}\n\`\`\`\n\nPlease backport manually!`;
await github.rest.issues.createComment({
owner: repo_owner,
repo: repo_name,
issue_number: pr_number,
body: git_am_failed_body
});
core.setFailed("Error: git am failed, most likely due to a merge conflict.");
return;
}
else {
// push the temp branch to the repository
await exec.exec(`git push --force --set-upstream origin HEAD:${temp_branch}`);
}

// push the temp branch to the repository
await exec.exec(`git push --force --set-upstream origin HEAD:${temp_branch}`);

if (!should_open_pull_request) {
console.log("Backport temp branch already exists, skipping opening a PR.");
Expand Down Expand Up @@ -268,13 +188,8 @@ jobs:
.replace(/%source_pr_author%/g, context.payload.issue.user.login)
.replace(/%cc_users%/g, cc_users);

const backport_pr_labels = (process.env.BACKPORT_PR_LABELS || '')
.split(',')
.map(label => label.trim())
.filter(label => label.length > 0);

// open the GitHub PR
const { data: backportPullRequest } = await github.rest.pulls.create({
await github.rest.pulls.create({
owner: repo_owner,
repo: repo_name,
title: backport_pr_title,
Expand All @@ -283,23 +198,21 @@ jobs:
base: target_branch
});

if (backport_pr_labels.length > 0) {
await github.rest.issues.addLabels({
owner: repo_owner,
repo: repo_name,
issue_number: backportPullRequest.number,
labels: backport_pr_labels
});
}

console.log("Successfully opened the GitHub PR.");
} catch (error) {
const body = `@${comment_user} an error occurred while backporting to \`${target_branch}\`. See the [workflow output](${workflow_run_url}) for details.`;
const comment_url = await postComment(body);
console.log(`Posted comment: ${comment_url}`);

core.setFailed(error);
}

// post failure to GitHub comment
const unknown_error_body = `@${comment_user} an error occurred while backporting to "${target_branch}", please check the run log for details!\n\n${error.message}`;
await github.rest.issues.createComment({
owner: repo_owner,
repo: repo_name,
issue_number: pr_number,
body: unknown_error_body
});
}

- name: Re-lock PR comments
uses: actions/github-script@v7
if: ${{ github.event.issue.locked == true && (success() || failure()) }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/inter-branch-merge-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
if: steps.extract-configuration-values.outputs.configurationFound != 'true'
name: Read configuration status

- run: ${{ github.workspace }}\arcade-repository\.github\workflows\scripts\inter-branch-merge.ps1 -RepoName ${{ steps.fetch-repo-name.outputs.repository_name }} -RepoOwner ${{ github.repository_owner }} -MergeFromBranch $env:GITHUB_REF_NAME -MergeToBranch ${{ steps.extract-configuration-values.outputs.mergeToBranch }} -ResetToTargetPaths "${{ steps.extract-configuration-values.outputs.resetToTargetPaths }}" ${{ steps.extract-configuration-values.outputs.mergeSwitchArguments }}
- run: ${{ github.workspace }}\arcade-repository\.github\workflows\scripts\inter-branch-merge.ps1 -RepoName ${{ steps.fetch-repo-name.outputs.repository_name }} -RepoOwner ${{ github.repository_owner }} -MergeFromBranch $env:GITHUB_REF_NAME -MergeToBranch ${{ steps.extract-configuration-values.outputs.mergeToBranch }} ${{ steps.extract-configuration-values.outputs.mergeSwitchArguments }}
if: steps.extract-configuration-values.outputs.configurationFound == 'true'
name: Merge branches
working-directory: ${{ github.workspace }}/repository
Expand Down
79 changes: 1 addition & 78 deletions .github/workflows/scripts/inter-branch-merge.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ The current branch
Create a PR even if the only commits are from dotnet-maestro[bot]
.PARAMETER QuietComments
Do not tag commiters, do not comment on PR updates. Reduces GitHub notifications
.PARAMETER ResetToTargetPaths
Semicolon-separated list of glob patterns for files to reset to the target branch version.
After the merge branch is created, files matching these patterns will be checked out from
the target branch and committed, resolving potential merge conflicts for these files.
#>
[CmdletBinding(SupportsShouldProcess = $true)]
param(
Expand All @@ -40,10 +36,7 @@ param(

[switch]$AllowAutomatedCommits,

[switch]$QuietComments,

[Alias('r')]
[string]$ResetToTargetPaths = ""
[switch]$QuietComments
)

$ErrorActionPreference = 'stop'
Expand Down Expand Up @@ -112,70 +105,6 @@ function GetCommitterGitHubName($sha) {
return $null
}

function ResetFilesToTargetBranch($patterns, $targetBranch) {
if (-not $patterns -or $patterns.Count -eq 0) {
return
}

Write-Host "Resetting files to $targetBranch for patterns: $($patterns -join ', ')"

# Verify the target branch exists
$branchExists = & git rev-parse --verify "origin/$targetBranch" 2>&1
if ($LASTEXITCODE -ne 0) {
Write-Warning "Target branch 'origin/$targetBranch' does not exist. Skipping file reset."
return
}

# Configure git user for the commit
# Use GitHub Actions bot identity
Invoke-Block { & git config user.name "github-actions[bot]" }
Invoke-Block { & git config user.email "41898282+github-actions[bot]@users.noreply.github.com" }

# Track which patterns had changes
$processedPatterns = @()

foreach ($pattern in $patterns) {
$pattern = $pattern.Trim()
if (-not $pattern) {
continue
}

Write-Host "Processing pattern: $pattern"

# Use git checkout to reset files matching the pattern to the target branch
# The -- is needed to separate the revision from the pathspec
# Just attempt to checkout the pattern directly - git will handle whether files exist
try {
& git checkout "origin/$targetBranch" -- $pattern 2>&1 | Write-Host
if ($LASTEXITCODE -eq 0) {
Write-Host -f Green "Checked out pattern '$pattern' from $targetBranch"
$processedPatterns += $pattern
} else {
Write-Host -f Yellow "Pattern '$pattern' did not match any files in $targetBranch"
}
}
catch {
Write-Warning "Failed to checkout pattern '$pattern' from $targetBranch. Error: $_"
}
}

# Check if there are any changes to commit after processing all patterns
$status = & git status --porcelain
if ($status -and $processedPatterns.Count -gt 0) {
# Add all changes (the checkout already modified the specific files)
Invoke-Block { & git add -A }

# Create a commit message listing all patterns that were reset
$patternsList = $processedPatterns -join "`n- "
$commitMessage = "Reset files to $targetBranch`n`nReset patterns:`n- $patternsList"

Invoke-Block { & git commit -m $commitMessage }
Write-Host -f Green "Successfully reset files to $targetBranch for patterns: $patternsList"
} else {
Write-Host "No changes to commit after processing all patterns"
}
}

# see https://git-scm.com/docs/pretty-formats
$formatString = '%h %cn <%ce>: %s (%cr)'

Expand Down Expand Up @@ -222,12 +151,6 @@ try {
$mergeBranchName = "merge/$MergeFromBranch-to-$MergeToBranch"
Invoke-Block { & git checkout -B $mergeBranchName }

# Reset specified files to target branch if ResetToTargetPaths is configured
if ($ResetToTargetPaths) {
$patterns = $ResetToTargetPaths -split ";"
ResetFilesToTargetBranch $patterns $MergeToBranch
}

$remoteName = 'origin'
$prOwnerName = $RepoOwner
$prRepoName = $RepoName
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/scripts/read-configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,8 @@ if ($configuration -ne $null) {
$ExtraSwitches = $configuration['ExtraSwitches']
}

$ResetToTargetPaths = "";
if($configuration.ContainsKey('ResetToTargetPaths')){
# Convert array to semicolon-separated string for output
$ResetToTargetPaths = $configuration['ResetToTargetPaths'] -join ";"
}

"mergeSwitchArguments=$ExtraSwitches" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
"mergeToBranch=$MergeToBranch" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
"resetToTargetPaths=$ResetToTargetPaths" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
"configurationFound=$true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
}

Expand Down
Loading
Loading