2021-07-24 02:19:12 +00:00
|
|
|
name: Restructure files
|
2021-07-23 15:20:49 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-07-23 15:43:37 +00:00
|
|
|
branches: [ main ]
|
2021-07-23 15:20:49 +00:00
|
|
|
pull_request:
|
2021-07-23 15:43:37 +00:00
|
|
|
branches: [ main ]
|
2021-07-23 15:20:49 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-and-build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Install Prettier
|
|
|
|
run: npm install --save-dev --save-exact prettier
|
|
|
|
|
2021-07-24 02:19:12 +00:00
|
|
|
- name: Restructure files
|
2021-07-23 15:43:37 +00:00
|
|
|
run: node_modules/.bin/prettier --write README.md animation-simulation/
|
2021-07-23 15:20:49 +00:00
|
|
|
|
|
|
|
- name: Commit files
|
|
|
|
run: |
|
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
2021-07-24 03:21:06 +00:00
|
|
|
git diff-index --quiet HEAD -- || git commit -am "代码重构 【Github Actions】"
|
2021-07-23 15:20:49 +00:00
|
|
|
|
|
|
|
- name: Push changes
|
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: ${{ github.ref }}
|