Skip to content

Commit a34e9d0

Browse files
committed
gha - don't stop if Pipefile.lock is modified, but add a warning about it
This is because it should not break the tests suite, but still is something to deal with
1 parent aa98c3d commit a34e9d0

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/actions/quarto-dev/action.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,28 @@ runs:
4242
echo "Unexpected package/dist/share path detected: $(quarto --paths)"
4343
Exit 1
4444
}
45-
If ( "$(git status --porcelain)" -ne "" ) {
46-
echo "Uncommitted changes detected:"
47-
git status --porcelain
48-
Exit 1
45+
# check if configure is modifying some files as it should not
46+
$modifiedFiles = git diff --name-only
47+
If ($modifiedFiles -ne "") {
48+
49+
# Convert the list to an array
50+
$modifiedFilesArray = $modifiedFiles -split "`n" | ForEach-Object { $_.Trim() }
51+
52+
If ($modifiedFilesArray -contains "tests/Pipfile.lock") {
53+
Write-Output "::warning::test/Pipfile.lock has been modified."
54+
$modifiedFilesArray = $modifiedFilesArray | Where-Object { $_ -notmatch "Pipfile.lock" }
55+
}
56+
57+
# Count the number of modified files
58+
$modifiedFilesCount = $modifiedFilesArray.Count
59+
60+
If ($modifiedFilesCount -ge 1) {
61+
Write-Output "::error::Uncommitted changes detected."
62+
foreach ($file in $modifiedFilesArray) {
63+
Write-Output $file
64+
}
65+
Exit 1
66+
}
4967
}
5068
5169
- name: Quarto Check

0 commit comments

Comments
 (0)