Skip to content

Commit de4005f

Browse files
committed
update actions
1 parent d3dc551 commit de4005f

1 file changed

Lines changed: 29 additions & 37 deletions

File tree

.github/workflows/sub-module.yml

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,36 @@
1-
# on:
2-
# push:
3-
# branches: ['master']
4-
# workflow_dispatch:
1+
on:
2+
workflow_dispatch:
53

6-
# name: Sync Submodule
4+
name: Sync Submodule
75

8-
# env:
9-
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6+
env:
7+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108

11-
# jobs:
12-
# sync-submodule:
13-
# name: Sync Submodule
14-
# runs-on: ubuntu-latest
15-
# steps:
16-
# - name: Checkout
17-
# uses: actions/checkout@v3
9+
jobs:
10+
sync-submodule:
11+
name: Sync Submodule
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
1816

19-
# - name: Pull all submodule
20-
# run: git submodule update --init --recursive
17+
- name: Pull all submodule
18+
run: git submodule update --remote --merge
2119

22-
# - name: Setup Node.js
23-
# uses: actions/setup-node@v2
24-
# with:
25-
# node-version: "16"
26-
27-
# - name: Setup Git
28-
# run: |
29-
# git config user.name '${{secrets.MAINTAINER_NAME}}'
30-
# git config user.email '${{secrets.MAINTAINER_EMAIL}}'
31-
32-
# - name: Sync submodule
33-
# run: |
34-
# git submodule update --remote --merge
20+
- name: Setup Git
21+
run: |
22+
git config user.name '${{secrets.MAINTAINER_NAME}}'
23+
git config user.email '${{secrets.MAINTAINER_EMAIL}}'
3524
36-
# - name: Create pull request
37-
# run: |
38-
# git add .
39-
# git checkout -b sync-submodule
40-
# git config pull.rebase false
41-
# git pull origin sync-submodule
42-
# git push --set-upstream origin sync-submodule
43-
# gh pr create --title "Sync submodule" --body "Sync submodule" --base master --head sync-submodule --repo ${{ github.repository }}
25+
- name: Create new branch
26+
run: git checkout -b submodule-sync-${{ github.sha }}
4427

28+
- name: Sync submodule
29+
run: |
30+
git submodule update --remote --merge
31+
32+
- name: Create pull request
33+
run: |
34+
git add .
35+
git commit -m "Sync submodules - Updated submodules" || echo "No changes to commit"
36+
git push origin submodule-sync-${{ github.sha }}

0 commit comments

Comments
 (0)