Skip to content

Commit 493768e

Browse files
authored
Record vLLM commit in PR description (#1623)
### What this PR does / why we need it? This patch enables the vllm commits recording and also cleanup unused commit msg note in PR. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - CI passed - Test on Yikun#33 and vllm commit refreshed as expected. Signed-off-by: Yikun Jiang <yikunkero@gmail.com>
1 parent 7efa4e9 commit 493768e

File tree

2 files changed

+115
-0
lines changed

2 files changed

+115
-0
lines changed

.github/format_pr_body.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#
2+
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# This file is a part of the vllm-ascend project.
16+
#
17+
18+
#!/bin/bash
19+
20+
set -eux
21+
22+
# ensure 2 argument is passed
23+
if [ "$#" -ne 3 ]; then
24+
echo "Usage: $0 <pr_number> <vllm_version> <vllm_commit>"
25+
exit 1
26+
fi
27+
28+
PR_NUMBER=$1
29+
VLLM_VERSION=$2
30+
VLLM_COMMIT=$3
31+
OLD=/tmp/orig_pr_body.txt
32+
NEW=/tmp/new_pr_body.txt
33+
34+
gh pr view --json body --template "{{.body}}" "${PR_NUMBER}" > "${OLD}"
35+
cp "${OLD}" "${NEW}"
36+
37+
# Remove "FIX #xxxx (*link existing issues this PR will resolve*)"
38+
sed -i '/<!--/,/-->/d' "${NEW}"
39+
sed -i '/- vLLM .*$/d' "${NEW}"
40+
echo "- vLLM version: $VLLM_VERSION" >> "${NEW}"
41+
echo "- vLLM main: $VLLM_COMMIT" >> "${NEW}"
42+
43+
# Run this only if ${NEW} is different than ${OLD}
44+
if ! cmp -s "${OLD}" "${NEW}"; then
45+
echo
46+
echo "Updating PR body:"
47+
echo
48+
cat "${NEW}"
49+
gh pr edit --body-file "${NEW}" "${PR_NUMBER}"
50+
else
51+
echo "No changes needed"
52+
fi

.github/workflows/format_pr_body.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#
2+
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# This file is a part of the vllm-ascend project.
16+
#
17+
18+
name: format / pr body
19+
20+
on:
21+
# The PR updated when PR opened and push new commits
22+
pull_request_target:
23+
types: [opened, synchronize]
24+
branches:
25+
- 'main'
26+
27+
permissions:
28+
pull-requests: write
29+
30+
jobs:
31+
update-description:
32+
name: update vLLM version
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout vllm-project/vllm repo
37+
uses: actions/checkout@v4
38+
with:
39+
repository: vllm-project/vllm
40+
path: ./vllm-empty
41+
42+
- name: Get vLLM version
43+
working-directory: ./vllm-empty
44+
run: |
45+
VLLM_COMMIT=$(git rev-parse HEAD)
46+
echo "VLLM_COMMIT=https://github.com/vllm-project/vllm/commit/$VLLM_COMMIT" >> $GITHUB_ENV
47+
48+
- name: Checkout repository
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
51+
- name: Set up Python
52+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
53+
54+
- name: Get vLLM release version
55+
run: |
56+
VLLM_VERSION=$(python3 docs/source/conf.py | jq .vllm_version | tr -d '"')
57+
echo "VLLM_VERSION=$VLLM_VERSION" >> $GITHUB_ENV
58+
59+
- name: Update PR description
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
run: |
63+
bash .github/format_pr_body.sh "${{ github.event.number }}" "${{ env.VLLM_VERSION }}" "${{ env.VLLM_COMMIT }}"

0 commit comments

Comments
 (0)