Skip to content

Commit b5fb2a9

Browse files
committed
attach patch as artifact
1 parent 3e4cd77 commit b5fb2a9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/run-scripts.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,13 @@ jobs:
4444
- name: Commit changes
4545
shell: pwsh
4646
run: |
47-
git diff > ../changes.diff
48-
$changes = Get-Item ../changes.diff
47+
git diff > ../changes.patch
48+
$changes = Get-Item ../changes.patch
4949
5050
Write-Output "Diff size is $($changes.Length) bytes"
5151
5252
if ($changes.Length -gt 20480) {
53-
$changesDiffContent = Get-Content -Path ../changes.diff
54-
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "## Changes diff"
55-
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value '```'
56-
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value $changesDiffContent
57-
Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value '```'
58-
throw "Changes diff is > 20KB - too much change to trust without verifying"
53+
throw "Changes diff is > 20KB - too much change to trust without verifying. changed.patch file have been created as an artifact. To merge this file run 'git apply changes.patch'"
5954
return 1
6055
}
6156
if ($changes.Length -eq 0) {
@@ -71,6 +66,13 @@ jobs:
7166
7267
Write-Output "Pushing changes to origin"
7368
git push origin master
69+
- uses: actions/upload-artifact@v4
70+
name: Attach patch as artifact
71+
if: ${{ always() }}
72+
with:
73+
name: changes.patch
74+
path: ../changes.patch
75+
if-no-files-found: ignore
7476
- name: Notify Slack on failure
7577
if: ${{ failure() }}
7678
shell: pwsh

0 commit comments

Comments
 (0)