bioarchlinux-tools/webhooks/config.py
2022-10-17 15:58:40 +00:00

23 lines
645 B
Python

from pathlib import Path
import time
MY_GITHUB = 'BioArchLinuxBot'
REPO_NAME = 'BioArchLinux/Packages'
ADMIN_GH = 'starsareintherose'
REPO_URL = f'git@github.com:{REPO_NAME}.git'
MYMAIL = 'lilac@bioarchlinux.org'
REPODIR = Path('/home/bio/Packages/BioArchLinux').expanduser()
def gen_log_comment(pkgs: list[str]) -> str:
ss = ['''\
| pkgbase | build history | last build log |
| --- | --- | --- |''']
t = int(time.time())
for pkg in set(pkgs):
ss.append(f'''\
| {pkg} \
| [build history](https://build.bioarchlinux.org/#{pkg}) \
| [last build log](https://build.bioarchlinux.org/api/pkg/{pkg}/log/{t}) |''')
return '\n'.join(ss)