Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
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
28 changes: 28 additions & 0 deletions .github/workflows/pr-desc-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# A workflow to check if comment exists in PR description
name: pr description check

on:
pull_request:
types: [opened, edited, reopened]

jobs:
pr-description-check:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.title, '[bot]')"
steps:
- name: pr-desciption-check
uses: NVIDIA/spark-rapids-common/pr-description-check@main
33 changes: 33 additions & 0 deletions pr-description-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'PR Description Check'
description: 'check if comment exists in PR description'

runs:
using: "composite"
steps:
- name: Get PR description
id: pr_description
uses: actions/github-script@v7
with:
script: |
return context.payload.pull_request?.body || '';
Copy link
Member

@pxLi pxLi May 22, 2025

Choose a reason for hiding this comment

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

nit: looks like github-script could cover the whole process and also leverage the core.setFailed() to update the fail message to the check status directly. Can you try ask LLM to generate some JS code if possible, thanks
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Do you have the screenshot for the failed one in check status? Or let me edit again

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image
image

Now we can update the status in PR check list

Copy link
Member

Choose a reason for hiding this comment

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

nice! can we make merge them into the same check instead of create another status item

Copy link
Collaborator Author

@YanxuanLiu YanxuanLiu May 23, 2025

Choose a reason for hiding this comment

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

Optimized the context name:
image
image


- name: Check comment in PR description
shell: bash
if: contains(steps.pr_description.outputs.result, '<!--')
run: |
echo "Error: PR description contains comment in '<!--'. Please remove the comment manually."
exit 1