-
Notifications
You must be signed in to change notification settings - Fork 15
44 lines (38 loc) · 1.15 KB
/
update_readme.yml
File metadata and controls
44 lines (38 loc) · 1.15 KB
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
name: update_readme
on:
workflow_dispatch:
issues:
types: [opened, edited, labeled, unlabeled]
issue_comment:
types: [created, edited]
push:
branches:
- master
paths:
- main.py
jobs:
update-readme:
runs-on: ubuntu-latest
if: github.repository_owner_id == github.event.issue.user.id || github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests PyGithub
- name: Get issue data and update README.md
run: python main.py --issue_number '${{ github.event.issue.number }}'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push readme
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add backup/*.md
git commit -a -m 'update new record' || echo "nothing to commit"
git push || echo "nothing to push"