-name:Setupcommitterid run:|# run: |在yaml格式中表示多行文本标识符 gitconfig--globaluser.email"pytorchmergebot@users.noreply.github.com" gitconfig--globaluser.name"PyTorch MergeBot" -name:MergePR shell:bash env: GITHUB_TOKEN:${{secrets.MERGEBOT_TOKEN}} PR_NUM:${{github.event.client_payload.pr_num}} FORCE:${{github.event.client_payload.force}} COMMENT_ID:${{github.event.client_payload.comment_id}} REBASE:${{github.event.client_payload.rebase}} IGNORE_CURRENT:${{github.event.client_payload.ignore_current}} ROCKSET_API_KEY:${{secrets.ROCKSET_API_KEY}} DRCI_BOT_KEY:${{secrets.DRCI_BOT_KEY}} GITHUB_RUN_ID:${{github.run_id}} run:| set -x # set -x表示在shell启动调试模式,在每一步命令运行之前输出相应命令 if [ -n "${REBASE}" ]; then # attempt to rebase, if it fails then comment on the PR that it failed if ! python3 .github/scripts/tryrebase.py "${PR_NUM}" --branch "${REBASE}"; then python3 .github/scripts/comment_on_pr.py "${PR_NUM}" "merge" exit 0 fi git checkout main git fetch -p # give github some time between the push and start workflows so that Github's messages # on the PR appear in chronological order (timing issues can shuffle them around) sleep 60 fi if [ -n "${FORCE}" ]; then if [ -n "${COMMENT_ID}" ]; then python3 .github/scripts/trymerge.py --force --comment-id "${COMMENT_ID}" "${PR_NUM}" else python3 .github/scripts/trymerge.py --force "${PR_NUM}" fi elif [ -n "${IGNORE_CURRENT}" ]; then if [ -n "${COMMENT_ID}" ]; then python3 .github/scripts/trymerge.py --ignore-current --comment-id "${COMMENT_ID}" "${PR_NUM}" else python3 .github/scripts/trymerge.py --ignore-current "${PR_NUM}" fi elif [ -n "${COMMENT_ID}" ]; then python3 .github/scripts/trymerge.py --comment-id "${COMMENT_ID}" "${PR_NUM}" else python3 .github/scripts/trymerge.py "${PR_NUM}" fi -name:CommentonCanceled if:${{cancelled()&&steps.checkout.outcome=='success'}} continue-on-error:true env: GITHUB_TOKEN:${{secrets.MERGEBOT_TOKEN}} PR_NUM:${{github.event.client_payload.pr_num}} run:| set -x python3 .github/scripts/comment_on_pr.py "${PR_NUM}" "merge" -name:configureawscredentials uses:aws-actions/configure-aws-credentials@v3 continue-on-error:true with: role-to-assume:arn:aws:iam::308535385114:role/upload_to_ossci_raw_job_status aws-region:us-east-1