Skip to content

如何基于Github Issues与Github Actions写技术博客? #50

如何基于Github Issues与Github Actions写技术博客?

如何基于Github Issues与Github Actions写技术博客? #50

Workflow file for this run

name: auto-update-readme-by-issue
on:
issues:
types: [opened, edited, milestoned,deleted,pinned,unpinned,closed,reopened,labeled,unlabeled]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: install dependencies
run: |
pip3 install setuptools --user
pip3 install PyGithub==1.57 --user
pip3 install wordcloud --user
pip3 install matplotlib --user
- name: run python script
env:
GITHUB_TOKEN: ${{ secrets.BLOG_SECRET }}
run: python3 main.py
- name: config git info
env:
USERNAME: ${{ secrets.GIT_USERNAME }}
EMAIL: ${{ secrets.GIT_EMAIL }}
run: |
git config --global user.name $USERNAME
git config --global user.email $EMAIL
- name: commit change
run: |
git checkout master
git add .
git commit -m "Update from Github Action"
- name: push change
env:
USERNAME: ${{ secrets.GIT_USERNAME }}
GITHUB_TOKEN: ${{ secrets.BLOG_SECRET }}
run: |
git push https://$USERNAME:[email protected]/$GITHUB_REPOSITORY.git
- name: done
run: echo 'done'