Skip to content
Open
Changes from all 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
10 changes: 9 additions & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ on:
pull_request:
types: [opened, edited, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Comment on lines +22 to +24
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

For GitHub Actions pull_request workflows, is github.head_ref unique per PR across forks? What concurrency.group expression is recommended to avoid cross-PR cancellations?

💡 Result:

No, github.head_ref is not unique per PR across forks. It is the name of the source branch (head_ref) in the PR, which is not unique—different PRs (from same repo or forks) can use the same branch name like "feature-branch". Using it in concurrency.group would cause runs from different PRs with the same branch name to share the group and cancel each other. To avoid cross-PR cancellations, use a concurrency.group that incorporates the PR number, which is unique per PR regardless of forks. Recommended expression (at workflow level): concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true This cancels previous runs within the same PR (on new commits) but not across different PRs. Include github.workflow to scope to the same workflow if multiple workflows exist. The PR number is available in pull_request events from forks.

Citations:


🏁 Script executed:

cat -n .github/workflows/pr-check.yml | sed -n '20,30p'

Repository: NVIDIA/TensorRT-LLM

Length of output: 363


Scope concurrency key to PR number, not head_ref.

On line 23, using github.head_ref can cancel runs for different PRs that share the same branch name (common with forks). Use PR number so cancellation is limited to the same PR.

Suggested fix
 concurrency:
-  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
   cancel-in-progress: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-check.yml around lines 22 - 24, The concurrency group
currently uses github.head_ref which can collide across forks; update the group
expression (the concurrency: group value) to use the PR number instead by
replacing the github.head_ref fallback with github.event.pull_request.number
(and keep github.run_id as a fallback for non-PR runs) so cancellation is scoped
to the same pull request.


permissions:
pull-requests: read
contents: read

jobs:
check-pr-title:
name: Check PR Title Format
Expand Down Expand Up @@ -64,7 +72,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.12'

- name: Validate PR Checklist
env:
Expand Down