Skip to content

10月份-11月份计划🍾 #161

10月份-11月份计划🍾

10月份-11月份计划🍾 #161

name: Generate GitBlog README
on:
workflow_dispatch:
issues:
types: [opened, edited]
issue_comment:
types: [created, edited]
push:
branches:
- master
paths:
- main.py
env:
GITHUB_NAME: HealUP
GITHUB_EMAIL: [email protected]
jobs:
sync:
name: Generate README
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
cache-dependency-path: "requirements.txt"
- 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: Generate new md
run: |
source venv/bin/activate
python main.py ${{ secrets.G_T }} ${{ github.repository }} --issue_number '${{ github.event.issue.number }}'
- name: Push README
run: |
git config --local user.email "${{ env.GITHUB_EMAIL }}"
git config --local user.name "${{ env.GITHUB_NAME }}"
git add BACKUP/*.md
git commit -a -m 'update new blog' || echo "nothing to commit"
git push || echo "nothing to push"