-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 984 Bytes
/
encodingLine.yml
File metadata and controls
36 lines (30 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Add coding line to Python files
on:
push:
branches:
- master
jobs:
add_coding_line:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Add coding line to Python files
run: |
find . -type f -name "*.py" -not -path "./.deprecated/*" \
| while read file; do
if ! head -n 1 "$file" | grep -q 'coding: utf-8'; then
sed -i '1i # -*- coding: utf-8 -*-' "$file"
fi
done
- name: Commit changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
# Check if any changes were made
if [[ -n $(git status -s) ]]; then
git commit -am "Добавление строки с кодировкой"
git push
else
echo "No changes were made to the files."
fi