-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 1.69 KB
/
replace_readme.yml
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
58
59
# replace readme
name: Replace README
on:
workflow_dispatch:
inputs:
test:
description: 'Test'
required: false
issue_comment:
types: [created, edited]
env:
GITHUB_NAME: chenzaichun
GITHUB_EMAIL: chenzaichun@gmail.com
jobs:
sync:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Configure pip cache
uses: actions/cache@v1
id: pip-cache
with:
path: venv
key: pip-1-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
if: steps.pip-cache.outputs.cache-hit != 'true'
- name: Replace README
run: |
source venv/bin/activate
python main.py ${{ secrets.G_T }} ${{ github.repository }} --issue_numbe '${{ github.event.issue.number }}' --issue_label_name '${{ github.event.issue.labels[0].name }}'
# Fix for the unsafe repo error: https://github.com/repo-sync/pull-request/issues/84
- name: Run safe dir
run: |
git config --global --add safe.directory /github/workspace
- name: Push new README
uses: chenzaichun/commit@master
with:
github-token: ${{ secrets.G_T }}
commit-message: "Replace README"
files: README.md
rebase: 'true'
name: Chen, Zai-Chun
email: chenzaichun@gmail.com