Skip to content

Commit e6aa608

Browse files
committed
html
Signed-off-by: Leonid Petrov <lenia.petrov@gmail.com>
1 parent e6089f0 commit e6aa608

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

.github/workflows/github-actions-s3-publish.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,14 @@ jobs:
1414
- name: Build
1515
uses: jerryjvl/jekyll-build-action@v1
1616

17-
- name: Clean HTML files
17+
- name: Clean HTML files with sudo
1818
run: |
19-
# Ensure we have permissions
20-
chmod -R u+w _site
21-
22-
# Remove empty lines using Python (most reliable)
23-
python3 -c "
24-
import os
25-
import re
26-
for root, dirs, files in os.walk('_site'):
27-
for f in files:
28-
if f.endswith('.html'):
29-
path = os.path.join(root, f)
30-
with open(path, 'r') as file:
31-
content = file.read()
32-
content = re.sub(r'\n\s*\n', '\n', content)
33-
content = re.sub(r'^\s*\n', '', content, flags=re.MULTILINE)
34-
with open(path, 'w') as file:
35-
file.write(content)
36-
"
19+
# Use sudo for all operations
20+
sudo find _site -name "*.html" -type f | while read file; do
21+
sudo grep -v '^[[:space:]]*$' "$file" | sudo tee "$file.tmp" > /dev/null
22+
sudo mv "$file.tmp" "$file"
23+
done
24+
3725
3826
- name: Configure AWS credentials
3927
uses: aws-actions/configure-aws-credentials@v1

0 commit comments

Comments
 (0)