File tree Expand file tree Collapse file tree 2 files changed +53
-2
lines changed Expand file tree Collapse file tree 2 files changed +53
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Fetch and Rebase
2
+
3
+ description : Fetch and rebase for repository
4
+
5
+ inputs :
6
+ repo_path :
7
+ description : the path the repository locate on
8
+ required : true
9
+ remote_branch :
10
+ description : the branch rebased from
11
+ required : true
12
+ loop :
13
+ description : loop times when fails
14
+ required : true
15
+
16
+ runs :
17
+ using : composite
18
+ steps :
19
+ - name : Fetch and rebase
20
+ env :
21
+ REPO_PATH : ${{ inputs.repo_path }}
22
+ REMOTE_BRANCH : ${{ inputs.remote_branch }}
23
+ LOOP : ${{ inputs.loop }}
24
+ shell : bash
25
+ run : |
26
+ set +e
27
+
28
+ COUNT=0
29
+
30
+ for i in $(seq 1 ${LOOP})
31
+ do
32
+ pushd ${REPO_PATH} &&
33
+ git fetch --all &&
34
+ git rebase ${REMOTE_BRANCH} &&
35
+ git submodule sync &&
36
+ git submodule update --init --recursive &&
37
+ git reset --hard HEAD &&
38
+ git clean -dfx &&
39
+ git submodule foreach git reset --hard HEAD &&
40
+ git submodule foreach git clean -dfx &&
41
+ popd
42
+
43
+ if [[ $? -ne 0 ]]
44
+ then
45
+ let COUNT++
46
+ else
47
+ break
48
+ fi
49
+ done
50
+
51
+ [[ ${COUNT} -lt ${LOOP} ]] && true || false
Original file line number Diff line number Diff line change @@ -17,13 +17,13 @@ jobs:
17
17
runs-on : ${{ inputs.runner }}
18
18
steps :
19
19
- name : Pull latest codes for torch
20
- uses : ascend /pytorch/.github/actions/fetch-and-rebase@master
20
+ uses : cosdt /pytorch-integration-tests /.github/actions/fetch-and-rebase@main
21
21
with :
22
22
repo_path : /home/runner/actions-runner/codes/pytorch/pytorch
23
23
remote_branch : upstream/main
24
24
loop : ${{ inputs.loop }}
25
25
- name : Pull latest codes for torch_npu
26
- uses : ascend /pytorch/.github/actions/fetch-and-rebase@master
26
+ uses : cosdt /pytorch-integration-tests /.github/actions/fetch-and-rebase@main
27
27
with :
28
28
repo_path : /home/runner/actions-runner/codes/npu/pytorch
29
29
remote_branch : upstream/master
You can’t perform that action at this time.
0 commit comments