From d13188c458ad767576169fe147d0865e163e1a3e Mon Sep 17 00:00:00 2001 From: satya_prakash <155617493+SATYAsasini@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:15:34 +0530 Subject: [PATCH] misc: skip for sync PRs, remove issue opened check for pr validator (#6244) * fix: skip for sync PRs, remove issue opened check for pr validator * misc: retained old code and commented them instead deleting --- .github/semantic.yml | 1 + .github/workflows/pr-issue-validator.yaml | 33 ++++++++++++----------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/semantic.yml b/.github/semantic.yml index 6524a15721..1de5695429 100644 --- a/.github/semantic.yml +++ b/.github/semantic.yml @@ -11,3 +11,4 @@ types: - doc - release - misc + - sync diff --git a/.github/workflows/pr-issue-validator.yaml b/.github/workflows/pr-issue-validator.yaml index 4c393f63e7..7bfc34294c 100644 --- a/.github/workflows/pr-issue-validator.yaml +++ b/.github/workflows/pr-issue-validator.yaml @@ -53,7 +53,7 @@ jobs: set -x # Skip validation for documentation or chore PRs - if [[ "$TITLE" =~ ^(doc:|docs:|chore:|misc:|Release:|release:) ]]; then + if [[ "$TITLE" =~ ^(doc:|docs:|chore:|misc:|Release:|release:|Sync:|sync:) ]]; then echo "Skipping validation for docs/chore PR." echo "PR NUMBER-: $PRNUM " gh pr edit $PRNUM --remove-label "PR:Issue-verification-failed" @@ -140,11 +140,10 @@ jobs: --header "authorization: Bearer ${{ secrets.GH_PR_VALIDATOR_TOKEN }}" \ "$issue_api_url"| jq '.state'|tr -d \") fi - echo "Issue Status: $issue_status" - + echo "Issue Number : $issue_num Status: $issue_status" # Check if the issue is still open. - if [[ "$issue_status" == open ]]; then - echo "Issue #$issue_num is opened." + # if [[ "$issue_status" == open ]]; then + # echo "Issue #$issue_num is opened." if [[ $forked == true ]]; then echo "PR:Ready-to-Review, exiting gracefully" exit 0 @@ -152,20 +151,22 @@ jobs: # Remove the 'Issue-verification-failed' label (if present) and add 'Ready-to-Review'. gh pr edit $PRNUM --remove-label "PR:Issue-verification-failed" gh pr edit $PRNUM --add-label "PR:Ready-to-Review" - else - echo "Issue #$issue_num is closed. Please link an open issue to proceed." - if [[ $forked == true ]]; then - echo "PR:Ready-to-Review, exiting gracefully" - exit 0 - fi + echo "PR:Ready-to-Review, exiting gracefully" + exit 0 + # else + # echo "Issue #$issue_num is closed. Please link an open issue to proceed." + # if [[ $forked == true ]]; then + # echo "PR:Ready-to-Review, exiting gracefully" + # exit 0 + # fi # Add a comment to the PR indicating the issue is not linked correctly. - gh pr comment $PRNUM --body "PR is linked to a closed issue. Please link an open issue to proceed." + # gh pr comment $PRNUM --body "PR is linked to a closed issue. Please link an open issue to proceed." # Add the 'Issue-verification-failed' label and remove 'Ready-to-Review'. - gh pr edit $PRNUM --add-label "PR:Issue-verification-failed" - gh pr edit $PRNUM --remove-label "PR:Ready-to-Review" - exit 1 - fi + # gh pr edit $PRNUM --add-label "PR:Issue-verification-failed" + # gh pr edit $PRNUM --remove-label "PR:Ready-to-Review" + # exit 1 + #fi else echo "Issue not found. Invalid URL or issue number." # Add a comment to the PR indicating the issue is not linked correctly.