-
Notifications
You must be signed in to change notification settings - Fork 32
57 lines (56 loc) · 1.72 KB
/
generate_article.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: generate_article
on:
issue_comment:
types:
- created
jobs:
generate_article:
runs-on: "ubuntu-latest"
if: |
!github.event.issue.pull_request &&
contains(github.event.comment.body, '/generate')
steps:
- name: install chromium
run: |
sudo apt-get update
sudo apt-get install -y chromium-browser libxss1 \
fonts-ipafont-gothic fonts-wqy-zenhei \
fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
--no-install-recommends
- run: chromium-browser --version
- uses: actions/setup-python@v2
with:
python-version: '3.12'
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: pipenv install
run: |
pip install pipenv
pipenv install
- name: npm install
run: |
(cd previews && \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install)
- name: install pandoc
run: |
wget https://github.com/jgm/pandoc/releases/download/2.18/pandoc-2.18-1-amd64.deb -O pandoc.deb
sudo dpkg -i pandoc.deb
rm pandoc.deb
- name: Generate files
id: generate
run: |
sudo ln -s `which bash` /bin/gitbash
pipenv run python scripts/pandoc_google_doc.py \
--fileid ${FILE} \
--author "todo" \
--tags "todo"
- uses: EndBug/add-and-commit@v8
with:
message: "Post: ${{ steps.generate.outputs.post-id }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
id: cpr
with:
assignees: alexeygrigorev
title: "Post: ${{ github.event.issue.title }}"