Skip to content

Commit 11b6b03

Browse files
committed
Record commit test
Signed-off-by: Yikun Jiang <yikunkero@gmail.com>
1 parent 4e91018 commit 11b6b03

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

.github/format_pr_body.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -eux
4+
5+
# ensure 2 argument is passed
6+
if [ "$#" -ne 2 ]; then
7+
echo "Usage: $0 <pr_number> <new_message>"
8+
exit 1
9+
fi
10+
11+
PR_NUMBER=$1
12+
NEW_MESSAGE=$2
13+
OLD=/tmp/orig_pr_body.txt
14+
NEW=/tmp/new_pr_body.txt
15+
16+
gh pr view --json body --template "{{.body}}" "${PR_NUMBER}" > "${OLD}"
17+
cp "${OLD}" "${NEW}"
18+
19+
# Remove "FIX #xxxx (*link existing issues this PR will resolve*)"
20+
sed -i '/<!--/,/-->/d' "${NEW}"
21+
echo "$NEW_MESSAGE" >> "${NEW}"
22+
23+
# Run this only if ${NEW} is different than ${OLD}
24+
if ! cmp -s "${OLD}" "${NEW}"; then
25+
echo
26+
echo "Updating PR body:"
27+
echo
28+
cat "${NEW}"
29+
# Enable this after workflow merged
30+
# gh pr edit --body-file "${NEW}" "${PR_NUMBER}"
31+
else
32+
echo "No changes needed"
33+
fi
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Cleanup PR Body
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, edited]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
update-description:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
20+
with:
21+
python-version: '3.12'
22+
23+
- name: Update PR description
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: bash .github/format_pr_body.sh "${{ github.event.number }}" ""

.github/workflows/vllm_ascend_test.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ on:
5252
- '.github/workflows/actionlint.*'
5353
- '.github/workflows/matchers/actionlint.json'
5454

55+
# Required to PR body update
56+
permissions:
57+
pull-requests: write
58+
contents: write
59+
5560
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
5661
# declared as "shell: bash -el {0}" on steps that need to be properly activated.
5762
# It's used to activate ascend-toolkit environment variables.
@@ -158,9 +163,18 @@ jobs:
158163
ref: ${{ matrix.vllm_version }}
159164
path: ./vllm-empty
160165

166+
- name: Update PR description
167+
if: ${{ github.event_name == 'pull_request' && matrix.vllm_version == 'main' }}
168+
env:
169+
GH_TOKEN: ${{ github.token }}
170+
run: |
171+
bash $GITHUB_WORKSPACE/.github/format_pr_body.sh "${{ github.event.number }}" "vLLM: ${{ env.VLLM_COMMIT_URL }}"
172+
161173
- name: Install vllm-project/vllm from source
162174
working-directory: ./vllm-empty
163175
run: |
176+
VLLM_COMMIT=$(git rev-parse HEAD)
177+
echo "VLLM_COMMIT_URL=https://github.com/vllm-project/vllm/commit/$VLLM_COMMIT" >> $GITHUB_ENV
164178
VLLM_TARGET_DEVICE=empty python3 -m pip install . --extra-index https://download.pytorch.org/whl/cpu/
165179
python3 -m pip uninstall -y triton
166180

0 commit comments

Comments
 (0)