[Bugfix] Fixed permission issues with the automatic PR submission workflow (#7142)

### What this PR does / why we need it?
Auto submit a pull request via
https://github.com/vllm-ascend-ci/vllm-ascend, the workflow looks like:
1. get a new config.yaml via run e2e tests
2. push the changed `config.yaml` to a new branch of
https://github.com/vllm-ascend-ci/vllm-ascend
3. submit a pull request to vllm-ascend via gh cli
### Does this PR introduce _any_ user-facing change?

### How was this patch tested?

- vLLM version: v0.16.0
- vLLM main:
4034c3d32e

---------

Signed-off-by: wangli <wangli858794774@gmail.com>
This commit is contained in:
Li Wang
2026-03-12 17:18:59 +08:00
committed by GitHub
parent e5343d6eb3
commit d866e6b238

View File

@@ -14,6 +14,11 @@ permissions:
contents: write
pull-requests: write
env:
UPSTREAM_REPO: vllm-project/vllm-ascend
FORK_OWNER: vllm-ascend-ci
BRANCH_NAME: auto/update-estimated-times-${{ github.run_id }}
concurrency:
group: update-estimated-times-${{ github.ref }}
cancel-in-progress: true
@@ -23,7 +28,7 @@ jobs:
name: e2e-test
strategy:
matrix:
vllm_version: [15d76f74e2fdb12a95ea00f0ca283acf6219a2b7]
vllm_version: [v0.16.0]
type: [full, light]
uses: ./.github/workflows/_e2e_test.yaml
with:
@@ -38,8 +43,10 @@ jobs:
needs: [e2e-test]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
- name: Checkout fork repo
uses: actions/checkout@v6
with:
repository: ${{ env.FORK_OWNER }}/vllm-ascend
- name: Download all timing artifacts
uses: actions/download-artifact@v4
@@ -58,6 +65,13 @@ jobs:
python -m pip install --upgrade pip
pip install pyyaml
- name: Config git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote add upstream https://github.com/${{ env.UPSTREAM_REPO }}.git
git fetch upstream main && git checkout -b ${{ env.BRANCH_NAME }} upstream/main
- name: Update config.yaml from timing data
run: |
python3 .github/workflows/scripts/update_estimated_time.py \
@@ -77,35 +91,35 @@ jobs:
fi
- name: Create pull request
if: steps.check_changes.outputs.changed == 'true' && github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
BRANCH="auto/update-estimated-times-${{ github.run_id }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$BRANCH"
git add .github/workflows/scripts/config.yaml
git commit -m "[CI] Auto-update estimated test times in config.yaml
Computed from timing-data artifacts of workflow run ${{ github.run_id }}.
Buffer ratio: 1.1x median, rounded to the nearest 10 s."
git push origin "$BRANCH"
git commit -sm "[CI] Auto-update estimated test times in config.yaml Computed from timing-data artifacts on workflow run-${{ github.run_id }}"
git remote -v
git push -f origin ${{ env.BRANCH_NAME }}:${{ env.BRANCH_NAME }}
gh pr create \
--repo "${{ github.repository }}" \
--repo ${{ env.UPSTREAM_REPO }} \
--base main \
--head "$BRANCH" \
--title "chore: Auto-update estimated test times in config.yaml" \
--head ${{ env.FORK_OWNER }}:${{ env.BRANCH_NAME }} \
--title "[CI]: Auto-update estimated test times in config.yaml" \
--body "## Summary
This PR was auto-generated by the **Update estimated test times** workflow.
This PR was auto-generated by the **Update estimated test times** [workflow](https://github.com/${{ env.UPSTREAM_REPO }}/actions/runs/${{ github.run_id }}).
It updates the \`estimated_time\` values in \`.github/workflows/scripts/config.yaml\`
based on actual elapsed times collected from workflow run \`${{ github.run_id }}\`.
It updates the \`estimated_time\` values in \`.github/workflows/scripts/config.yaml\` based on actual elapsed times collected from CI workflow runs.
### Methodology
- Timing data is uploaded as \`timing-data-*\` artifacts by each e2e test job.
- For each test file, the **median** of all collected elapsed times is taken.
- A **10 % safety buffer** is applied and the result is rounded to the nearest 10 s.
Please review the diff and merge if the new values look reasonable."
- Each e2e test job uploads its elapsed time as a \`timing-data-*\` artifact upon completion.
- The workflow aggregates all collected timing artifacts across jobs.
- For each test, the **median** elapsed time is computed to reduce outlier impact.
- A **10% safety buffer** is applied and the result is rounded to the nearest 10 seconds.
### Review Checklist
- [ ] Verify that updated \`estimated_time\` values are within a reasonable range.
- [ ] Confirm no test entries are missing or unexpectedly removed.
> If the new values look reasonable, feel free to merge. Otherwise, leave a comment describing the anomaly."