7. GitHub Actions - 在pull request中执行eslint检测的工作流例子 #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Issue to Hexo | |
on: | |
issues: | |
types: [ milestoned ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
# - name: work branch | |
# run: | | |
# git checkout -b feat/issue-to-hexo-$(date '+%Y%m%d%H%I%S') | |
- name: init pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: init node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
cache-dependency-path: 'src' | |
- name: cd hexo | |
run: | | |
cd src | |
ls -a | |
- name: install dependencies | |
run: | | |
ls -a | |
pnpm install | |
- name: generate issue to hexo | |
uses: somidad/[email protected] | |
with: | |
issue_url: ${{ github.event.issue.url }} | |
token: ${{ github.token }} | |
- name: generate hexo | |
run: | | |
cd .. | |
ls -a | |
pnpm run build | |
cd .. | |
- name: create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
title: New blog by Action | |
base: master | |
branch: feat/new-blog-by-action | |