From 5b514dfb9b956409a86855dac1bcefd18fd0c0d1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 15 Jun 2026 09:42:58 +0000 Subject: [PATCH 1/2] chore(ci): sync .github from master into alpha --- .github/scripts/Invoke-BranchPolicyCheck.ps1 | 7 +----- .github/workflows/pr-branch-policy.yml | 26 ++++++++------------ 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/.github/scripts/Invoke-BranchPolicyCheck.ps1 b/.github/scripts/Invoke-BranchPolicyCheck.ps1 index d03ff51d0..e6824387b 100644 --- a/.github/scripts/Invoke-BranchPolicyCheck.ps1 +++ b/.github/scripts/Invoke-BranchPolicyCheck.ps1 @@ -12,7 +12,7 @@ param( [string]$HeadRef, [Parameter(Mandatory = $true)] - [string]$ChangedFilesFile, + [string[]]$ChangedFiles, [Parameter(Mandatory = $true)] [string]$PolicyPath, @@ -26,11 +26,6 @@ param( $ErrorActionPreference = 'Stop' -$ChangedFiles = @() -if (Test-Path -LiteralPath $ChangedFilesFile) { - $ChangedFiles = @(Get-Content -LiteralPath $ChangedFilesFile -Raw | ConvertFrom-Json) -} - function Write-PolicyMessage { param( [ValidateSet('Warning', 'Error')] diff --git a/.github/workflows/pr-branch-policy.yml b/.github/workflows/pr-branch-policy.yml index 9e563c69b..2d90ca687 100644 --- a/.github/workflows/pr-branch-policy.yml +++ b/.github/workflows/pr-branch-policy.yml @@ -64,26 +64,20 @@ jobs: env: PR_BASE: ${{ github.event.pull_request.base.ref }} PR_HEAD: ${{ github.event.pull_request.head.ref }} + CHANGED_FILES: ${{ steps.files.outputs.paths }} POLICY_PATH: ${{ github.workspace }}/.github/branch-policy.json ENFORCE: ${{ vars.BRANCH_POLICY_ENFORCE }} REPOSITORY: ${{ github.repository }} run: | $ErrorActionPreference = 'Stop' $files = @() - if ("${{ steps.files.outputs.paths }}" -ne "") { - $files = "${{ steps.files.outputs.paths }}" -split "`n" | Where-Object { $_ } - } - $tempFile = Join-Path $env:RUNNER_TEMP "changed_files_$([guid]::NewGuid()).json" - $files | ConvertTo-Json -AsArray | Out-File -FilePath $tempFile -Encoding utf8 - try { - & "${{ github.workspace }}/.github/scripts/Invoke-BranchPolicyCheck.ps1" ` - -BaseRef $env:PR_BASE ` - -HeadRef $env:PR_HEAD ` - -ChangedFilesFile $tempFile ` - -PolicyPath $env:POLICY_PATH ` - -Enforce $(if ($env:ENFORCE) { $env:ENFORCE } else { 'false' }) ` - -Repository $env:REPOSITORY - } - finally { - Remove-Item -Force -LiteralPath $tempFile -ErrorAction SilentlyContinue + if ($env:CHANGED_FILES) { + $files = $env:CHANGED_FILES -split "`n" | Where-Object { $_ } } + & "${{ github.workspace }}/.github/scripts/Invoke-BranchPolicyCheck.ps1" ` + -BaseRef $env:PR_BASE ` + -HeadRef $env:PR_HEAD ` + -ChangedFiles $files ` + -PolicyPath $env:POLICY_PATH ` + -Enforce $(if ($env:ENFORCE) { $env:ENFORCE } else { 'false' }) ` + -Repository $env:REPOSITORY From 5a0c07d227b48c62cc5123d8644ef4287d9b3685 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Tue, 16 Jun 2026 08:26:31 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Revert=20"chore(ci):=20sync=20.github=20fro?= =?UTF-8?q?m=20master=20=E2=86=92=20alpha"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/scripts/Invoke-BranchPolicyCheck.ps1 | 7 +++++- .github/workflows/pr-branch-policy.yml | 26 ++++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/scripts/Invoke-BranchPolicyCheck.ps1 b/.github/scripts/Invoke-BranchPolicyCheck.ps1 index e6824387b..d03ff51d0 100644 --- a/.github/scripts/Invoke-BranchPolicyCheck.ps1 +++ b/.github/scripts/Invoke-BranchPolicyCheck.ps1 @@ -12,7 +12,7 @@ param( [string]$HeadRef, [Parameter(Mandatory = $true)] - [string[]]$ChangedFiles, + [string]$ChangedFilesFile, [Parameter(Mandatory = $true)] [string]$PolicyPath, @@ -26,6 +26,11 @@ param( $ErrorActionPreference = 'Stop' +$ChangedFiles = @() +if (Test-Path -LiteralPath $ChangedFilesFile) { + $ChangedFiles = @(Get-Content -LiteralPath $ChangedFilesFile -Raw | ConvertFrom-Json) +} + function Write-PolicyMessage { param( [ValidateSet('Warning', 'Error')] diff --git a/.github/workflows/pr-branch-policy.yml b/.github/workflows/pr-branch-policy.yml index 2d90ca687..9e563c69b 100644 --- a/.github/workflows/pr-branch-policy.yml +++ b/.github/workflows/pr-branch-policy.yml @@ -64,20 +64,26 @@ jobs: env: PR_BASE: ${{ github.event.pull_request.base.ref }} PR_HEAD: ${{ github.event.pull_request.head.ref }} - CHANGED_FILES: ${{ steps.files.outputs.paths }} POLICY_PATH: ${{ github.workspace }}/.github/branch-policy.json ENFORCE: ${{ vars.BRANCH_POLICY_ENFORCE }} REPOSITORY: ${{ github.repository }} run: | $ErrorActionPreference = 'Stop' $files = @() - if ($env:CHANGED_FILES) { - $files = $env:CHANGED_FILES -split "`n" | Where-Object { $_ } + if ("${{ steps.files.outputs.paths }}" -ne "") { + $files = "${{ steps.files.outputs.paths }}" -split "`n" | Where-Object { $_ } + } + $tempFile = Join-Path $env:RUNNER_TEMP "changed_files_$([guid]::NewGuid()).json" + $files | ConvertTo-Json -AsArray | Out-File -FilePath $tempFile -Encoding utf8 + try { + & "${{ github.workspace }}/.github/scripts/Invoke-BranchPolicyCheck.ps1" ` + -BaseRef $env:PR_BASE ` + -HeadRef $env:PR_HEAD ` + -ChangedFilesFile $tempFile ` + -PolicyPath $env:POLICY_PATH ` + -Enforce $(if ($env:ENFORCE) { $env:ENFORCE } else { 'false' }) ` + -Repository $env:REPOSITORY + } + finally { + Remove-Item -Force -LiteralPath $tempFile -ErrorAction SilentlyContinue } - & "${{ github.workspace }}/.github/scripts/Invoke-BranchPolicyCheck.ps1" ` - -BaseRef $env:PR_BASE ` - -HeadRef $env:PR_HEAD ` - -ChangedFiles $files ` - -PolicyPath $env:POLICY_PATH ` - -Enforce $(if ($env:ENFORCE) { $env:ENFORCE } else { 'false' }) ` - -Repository $env:REPOSITORY