File tree Expand file tree Collapse file tree 2 files changed +42
-2
lines changed Expand file tree Collapse file tree 2 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -46,14 +46,18 @@ jobs:
4646 tar -cf $REPO_NAME.tar ${{ github.event.client_payload.path }}
4747 python -m pip install bce-python-sdk==0.8.74
4848 # 获取远端的最新提交时间
49- latest_commit_time_remote=$(curl --silent --fail https://paddle-qa.bj.bcebos.com/CodeSync/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/latest_commit_time) || latest_commit_time_remote=""
49+ latest_commit_time_remote=$(curl --silent --fail https://paddle-qa.bj.bcebos.com/CodeSync/GitInfo/ ${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/latest_commit_time) || latest_commit_time_remote=0
5050 # 判断 latest_commit_time_remote 是否晚于 current_commit_time 时间
5151 if [ -n "$latest_commit_time_remote" ] && [ "$latest_commit_time_remote" -lt "$current_commit_time" ]; then
5252 echo "Executing upload as latest commit time ($latest_commit_time_remote) is earlier than current commit time ($current_commit_time)."
5353 python tools/bos_upload.py ${file_name} paddle-qa/CodeSync/${{ github.event.client_payload.ref }}/
5454 echo "Bos link: https://paddle-qa.bj.bcebos.com/CodeSync/${{ github.event.client_payload.ref }}/$file_name"
5555 echo "${current_commit_time}" >> latest_commit_time
56- python tools/bos_upload.py latest_commit_time paddle-qa/CodeSync/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}
56+ python tools/bos_upload.py latest_commit_time paddle-qa/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}
57+ echo "${current_commit}" >> latest_commit
58+ python tools/bos_upload.py latest_commit paddle-qa/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}
59+ echo "GitInfo link: https://paddle-qa.bj.bcebos.com/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/latest_commit_sha"
60+ echo "GitInfo link: https://paddle-qa.bj.bcebos.com/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/latest_commit_time"
5761 else
5862 echo "The latest commit time is later than the current commit. Skipping the commit operation."
5963 fi
Original file line number Diff line number Diff line change 1+ name : tools file sync to bos
2+ run-name : Tools file synchronization
3+ on :
4+ push :
5+ paths :
6+ - ' tools/bos_upload.py'
7+ - ' tools/linux_env_info.sh'
8+ workflow_dispatch :
9+
10+ jobs :
11+ upload_bos :
12+ if : ${{ !github.event.repository.fork }}
13+ environment : CodeSync
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : PaddleTest Checkout
17+ uses : actions/checkout@v4
18+ with :
19+ sparse-checkout : |
20+ tools
21+ - uses : actions/setup-python@v5
22+ with :
23+ python-version : ' 3.10'
24+ - name : Upload Code
25+ env :
26+ AK : ${{ secrets.BOS_AK }}
27+ SK : ${{ secrets.BOS_SK }}
28+ run : |
29+ tree -L 3
30+ echo "Repository: ${{ github.repository }}"
31+ echo "Branch: ${{ github.ref }}"
32+ python -m pip install bce-python-sdk==0.8.74
33+ branch=$(echo '${{ github.ref }}' | sed 's#refs/heads/##')
34+ python tools/bos_upload.py tools/bos_upload.py paddle-qa/CodeSync/${branch}/${{ github.repository }}
35+ python tools/bos_upload.py tools/linux_env_info.sh paddle-qa/CodeSync/${branch}/${{ github.repository }}
36+
You can’t perform that action at this time.
0 commit comments