From 31571a8a7b2adf29a1a92d23990304e90972c777 Mon Sep 17 00:00:00 2001 From: gushiwei Date: Tue, 25 Mar 2025 15:15:36 +0000 Subject: [PATCH 1/6] test=document_fix --- .github/workflows/Check-pr-template.yml | 69 +++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/Check-pr-template.yml diff --git a/.github/workflows/Check-pr-template.yml b/.github/workflows/Check-pr-template.yml new file mode 100644 index 00000000000000..808ea3bc45e8fc --- /dev/null +++ b/.github/workflows/Check-pr-template.yml @@ -0,0 +1,69 @@ +name: Check PR Template + +on: + pull_request_target: + types: [opened, synchronize, reopened, edited] + +env: + AGILE_PULL_ID: ${{ github.event.pull_request.number }} + GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + check: + name: Check + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Clone paddle + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.pull_request.number }}/merge + fetch-depth: 1000 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + cache: 'pip' + + - name: Install dependencies + run: | + pip install httpx + + - name: Check PR Template + run: | + python tools/CheckPRTemplate.py; EXCODE=$? + echo "EXCODE: $EXCODE" + echo "ipipe_log_param_EXCODE: $EXCODE" + set +x + if [[ "$EXCODE" != "0" ]];then + echo -e "######################################################" + echo -e "If you encounter a situation where the PR template does not match the error message, please use the following link to update your PR: [ https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/.github/PULL_REQUEST_TEMPLATE.md ]" + echo -e "##ReferenceDocumentation: ##" + echo -e "[ https://github.com/PaddlePaddle/Paddle/wiki/PULL-REQUEST-TEMPLATE--REFERENCE ]" + echo -e "[ https://github.com/PaddlePaddle/Paddle/wiki/paddle_ci_manual ]" + echo -e "######################################################" + fi + + - name: Icafe_log + env: + AGILE_COMPILE_BRANCH: ${{ github.event.pull_request.base.ref }} + method: check_pr + icafe_download_url: ${{ secrets.ICAFE_DOWNLOAD_URL }} + icafe_url: ${{ secrets.ICAFE_URL }} + icafe_user: ${{ secrets.ICAFE_USER }} + icafe_pwd: ${{ secrets.ICAFE_PWD }} + db_host: ${{ secrets.DB_HOST }} + db_port: ${{ secrets.DB_PORT }} + db_user: ${{ secrets.DB_USER }} + db_pd: ${{ secrets.DB_PD }} + db_name: ${{ secrets.DB_NAME }} + icafe_token: ${{ secrets.ICAFE_TOKEN }} + AGILE_CHECKIN_AUTHOR: ${{ github.event.pull_request.user.login }} + AGILE_REVISION: ${{ github.event.pull_request.head.sha }} + run: | + COMMIT_MESSAGE=$(git show -s --format='%s' $AGILE_REVISION) + AGILE_COMMENTS="[{\"Commit\":\"$AGILE_REVISION\",\"author\":\"$AGILE_CHECKIN_AUTHOR\",\"comment\":\"$COMMIT_MESSAGE\"}]" + wget -q --no-check-certificate $icafe_download_url + python modify_icafe.py From 8372df9aaef44f4fd23b572bc40ffcea4742e45c Mon Sep 17 00:00:00 2001 From: gushiwei Date: Tue, 25 Mar 2025 17:34:59 +0000 Subject: [PATCH 2/6] test=document_fix --- .github/workflows/Check-pr-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Check-pr-template.yml b/.github/workflows/Check-pr-template.yml index 808ea3bc45e8fc..6ccecf15ff6ec9 100644 --- a/.github/workflows/Check-pr-template.yml +++ b/.github/workflows/Check-pr-template.yml @@ -64,6 +64,6 @@ jobs: AGILE_REVISION: ${{ github.event.pull_request.head.sha }} run: | COMMIT_MESSAGE=$(git show -s --format='%s' $AGILE_REVISION) - AGILE_COMMENTS="[{\"Commit\":\"$AGILE_REVISION\",\"author\":\"$AGILE_CHECKIN_AUTHOR\",\"comment\":\"$COMMIT_MESSAGE\"}]" + export AGILE_COMMENTS="[{\"Commit\":\"$AGILE_REVISION\",\"author\":\"$AGILE_CHECKIN_AUTHOR\",\"comment\":\"$COMMIT_MESSAGE\"}]" wget -q --no-check-certificate $icafe_download_url python modify_icafe.py From 4333bda08f59f461f55470a3e3f710fa0cf4d84b Mon Sep 17 00:00:00 2001 From: gushiwei Date: Wed, 26 Mar 2025 01:14:11 +0000 Subject: [PATCH 3/6] test=document_fix --- .github/workflows/Check-pr-template.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Check-pr-template.yml b/.github/workflows/Check-pr-template.yml index 6ccecf15ff6ec9..055e887d2352e0 100644 --- a/.github/workflows/Check-pr-template.yml +++ b/.github/workflows/Check-pr-template.yml @@ -63,7 +63,9 @@ jobs: AGILE_CHECKIN_AUTHOR: ${{ github.event.pull_request.user.login }} AGILE_REVISION: ${{ github.event.pull_request.head.sha }} run: | + set +e COMMIT_MESSAGE=$(git show -s --format='%s' $AGILE_REVISION) export AGILE_COMMENTS="[{\"Commit\":\"$AGILE_REVISION\",\"author\":\"$AGILE_CHECKIN_AUTHOR\",\"comment\":\"$COMMIT_MESSAGE\"}]" wget -q --no-check-certificate $icafe_download_url python modify_icafe.py + exit 0 From 2b0327caed96f0a879fdc1dd6e9d3c341e377f6b Mon Sep 17 00:00:00 2001 From: gushiwei Date: Wed, 26 Mar 2025 01:17:00 +0000 Subject: [PATCH 4/6] test=document_fix --- .github/workflows/Check-pr-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Check-pr-template.yml b/.github/workflows/Check-pr-template.yml index 055e887d2352e0..5de8c5bd645d27 100644 --- a/.github/workflows/Check-pr-template.yml +++ b/.github/workflows/Check-pr-template.yml @@ -10,7 +10,7 @@ env: jobs: check: - name: Check + name: Check PR template runs-on: ubuntu-latest permissions: contents: read From 04031094c62d911fb074f9b1663a2c1557202de4 Mon Sep 17 00:00:00 2001 From: gushiwei Date: Wed, 26 Mar 2025 08:45:24 +0000 Subject: [PATCH 5/6] test --- .github/workflows/Check-pr-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Check-pr-template.yml b/.github/workflows/Check-pr-template.yml index 5de8c5bd645d27..60731396411864 100644 --- a/.github/workflows/Check-pr-template.yml +++ b/.github/workflows/Check-pr-template.yml @@ -1,4 +1,4 @@ -name: Check PR Template +name: Check pr template on: pull_request_target: From 333226345457177b357abe9a89009fe66854fc74 Mon Sep 17 00:00:00 2001 From: gushiwei Date: Fri, 28 Mar 2025 13:49:06 +0000 Subject: [PATCH 6/6] no AGILE_COMMENTS --- .github/workflows/Check-pr-template.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Check-pr-template.yml b/.github/workflows/Check-pr-template.yml index 60731396411864..5449ce0d935cad 100644 --- a/.github/workflows/Check-pr-template.yml +++ b/.github/workflows/Check-pr-template.yml @@ -61,11 +61,10 @@ jobs: db_name: ${{ secrets.DB_NAME }} icafe_token: ${{ secrets.ICAFE_TOKEN }} AGILE_CHECKIN_AUTHOR: ${{ github.event.pull_request.user.login }} + AGILE_TRIGGER_USER: ${{ github.event.pull_request.user.login }} AGILE_REVISION: ${{ github.event.pull_request.head.sha }} run: | set +e - COMMIT_MESSAGE=$(git show -s --format='%s' $AGILE_REVISION) - export AGILE_COMMENTS="[{\"Commit\":\"$AGILE_REVISION\",\"author\":\"$AGILE_CHECKIN_AUTHOR\",\"comment\":\"$COMMIT_MESSAGE\"}]" wget -q --no-check-certificate $icafe_download_url python modify_icafe.py exit 0