forked from duty-machine/duty-machine
-
Notifications
You must be signed in to change notification settings - Fork 32
50 lines (45 loc) · 1.4 KB
/
trans_md.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
40
41
42
43
44
45
46
47
48
49
50
name: push md files to source branch
on:
workflow_run:
workflows: ["generate a Markdown file"]
types:
- completed
jobs:
copy-file:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Pushes test file to bk
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUSH_MD }}
with:
source_file: 'docs'
destination_repo: 'ixxmu/duty_bk'
destination_branch: 'main'
destination_folder: 'mp_duty/'
user_email: ${{ secrets.MY_EMAIL }}
user_name: 'ixxmu'
commit_message: 'A custom message for the commit'
- name: Wait for file pushing
run: sleep 10 & pwd
- name: Delete Source Files
run: |
rm -rf docs # 删除源文件夹
- name: Delete Source Files
run: |
echo "Deleting posts directory..."
ls -alh # 打印当前目录结构以供检查
rm -rf docs # 删除posts文件夹
echo "After deletion:"
ls -alh # 再次打印当前目录结构确认删除
shell: bash
- name: Commit and Push Deletion
run: |
git config --global user.email ${{ secrets.MY_EMAIL }}
git config --global user.name "ixxmu"
git rm -rf docs
git commit -m "A custom message for the commit"
git push origin HEAD
shell: bash