-
Notifications
You must be signed in to change notification settings - Fork 8
39 lines (39 loc) · 972 Bytes
/
m2p.yml
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
name: main to gh-pages
on:
workflow_dispatch:
push:
branches:
- main
jobs:
m2p:
permissions:
contents: write
actions: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Git
env:
user_name: ${{ secrets.USER_NAME }}
user_email: ${{ secrets.USER_EMAIL }}
run: |
git config user.name "$user_name"
git config user.email "$user_email"
- name: Merge
run: |
git checkout gh-pages
git merge main -m "Merge branch 'main' into gh-pages" || printf 'skip'
- name: Setup Python
uses: actions/setup-python@v5
- name: Link Fix
run: |
cd ./教程/示例代码
python linkfix.py
git add .
git commit -m "linkfix" || printf 'skip'
cd ../../
- name: Push
run: git push