File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,9 @@ jobs:
116116 if [[ `git status --porcelain` ]]; then
117117 git add .
118118 git commit -m "Updated with commit ${{ inputs.commit_sha }} See: https://github.com/huggingface/${{ inputs.package }}/commit/${{ inputs.commit_sha }}"
119- git push origin main
119+ git push origin main ||
120+ (echo "Failed on the first try, rebasing and pushing again" && git pull --rebase && git push origin main) ||
121+ (echo "Failed on the second try, rebasing and pushing again" && git pull --rebase && git push origin main)
120122 else
121123 echo "No diff in the documentation."
122124 fi
@@ -134,7 +136,9 @@ jobs:
134136 if [[ `git status --porcelain` ]]; then
135137 git add ${{ inputs.notebook_folder }}
136138 git commit -m "Updated ${{ inputs.package }} doc notebooks with commit ${{ inputs.commit_sha }} \n\nSee: https://github.com/huggingface/${{ inputs.package }}/commit/${{ inputs.commit_sha }}"
137- git push origin master
139+ git push origin master ||
140+ (echo "Failed on the first try, rebasing and pushing again" && git pull --rebase && git push origin master) ||
141+ (echo "Failed on the second try, rebasing and pushing again" && git pull --rebase && git push origin master)
138142 else
139143 echo "No diff in the notebooks."
140144 fi
Original file line number Diff line number Diff line change 8989 if [[ `git status --porcelain` ]]; then
9090 git add .
9191 git commit -m "Updated with commit ${{ inputs.commit_sha }} See: https://github.com/huggingface/${{ inputs.package }}/commit/${{ inputs.commit_sha }}"
92- git push origin main
92+ git push origin main ||
93+ (echo "Failed on the first try, rebasing and pushing again" && git pull --rebase && git push origin main) ||
94+ (echo "Failed on the second try, rebasing and pushing again" && git pull --rebase && git push origin main)
9395 else
9496 echo "No diff in the documentation."
9597 fi
Original file line number Diff line number Diff line change 4040 if [[ `git status --porcelain` ]]; then
4141 git add .
4242 git commit -m "Closed PR ${{ inputs.pr_number }} in ${{ inputs.package }}"
43- git push origin main
43+ git push origin main ||
44+ (echo "Failed on the first try, rebasing and pushing again" && git pull --rebase && git push origin main) ||
45+ (echo "Failed on the second try, rebasing and pushing again" && git pull --rebase && git push origin main)
4446 else
4547 echo "Branch was already deleted, nothing to do."
4648 fi
You can’t perform that action at this time.
0 commit comments