mirror of
https://github.com/hect0x7/JMComic-Crawler-Python.git
synced 2025-09-26 22:31:30 +08:00
21 lines
374 B
Python
21 lines
374 B
Python
import os
|
|
import sys
|
|
import re
|
|
|
|
|
|
def add_output(k, v):
|
|
cmd = f'echo {k}="{v}" >> $GITHUB_OUTPUT'
|
|
print(cmd, os.system(cmd))
|
|
|
|
|
|
msg = sys.argv[1]
|
|
print(f'msg: {msg}')
|
|
p = re.compile('(.*?): ?(.*)')
|
|
match = p.search(msg)
|
|
assert match is not None, f'commit message format is wrong: {msg}'
|
|
|
|
tag, body = match[1], match[2]
|
|
|
|
add_output('tag', tag)
|
|
add_output('body', body)
|