File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 1
- FROM python :3.7.3
1
+ FROM alpine :3.7
2
2
3
3
LABEL author="Sep0lkit <sep0lkit@gmail.com>"
4
4
LABEL repository="https://github.com/Sep0lkit/git-issues-blog"
5
5
6
+ # Github action labels
6
7
LABEL com.github.actions.name="git-issues-blog"
7
8
LABEL com.github.actions.description="Auto build issues blog from github repo"
8
9
LABEL com.github.actions.icon="file-text"
9
10
LABEL com.github.actions.color="blue"
10
11
11
- COPY requirements.txt /tmp/
12
- RUN pip install --requirement /tmp/requirements.txt
12
+ # Install packages
13
+ RUN apk add --no-cache bash git jq
14
+ RUN apk add --no-cache python3 && python3 -m ensurepip && pip3 --no-cache-dir install --upgrade pip
15
+ RUN pip3 install requests PyGithub pathlib
16
+
13
17
14
18
COPY git-issues-blog.py /git-issues-blog.py
15
- COPY git_diff_files.txt /git_diff_files.txt
16
19
RUN chmod +x /git-issues-blog.py
17
20
ENTRYPOINT [ "/git-issues-blog.py" ]
Original file line number Diff line number Diff line change 38
38
with open (POST_INDEX_FILE , encoding = 'utf-8' , mode = 'r' ) as f :
39
39
dictionary = json .load (f )
40
40
lastcommit = dictionary ['__commit__' ]
41
+ command = "git diff --name-only -z " + lastcommit
42
+ changed = subprocess .check_output (command )
43
+ for x in changed .split (b'\x00 ' ):
44
+ if x .decode ('utf-8' ):
45
+ CHANGED .append (x .decode ('utf-8' ))
41
46
f .close ()
42
47
except Exception as e :
43
48
print ('%s load error: %s' % (POST_INDEX_FILE , e ))
44
49
exit (- 1 )
45
50
46
- # load changed fie list from git_diff_files.txt
47
- try :
48
- with open ('git_diff_files.txt' , encoding = 'utf-8' , mode = 'r' ) as f :
49
- for line in f :
50
- if line .strip () != "" :
51
- CHANGED .append (line .strip ())
52
- f .close ()
53
- except :
54
- print ('no changed file found' )
55
- CHANGED = []
56
51
57
52
p = pathlib .Path (POSTS_PATH )
58
53
for f in p .rglob ('*.md' ):
You can’t perform that action at this time.
0 commit comments