Skip to content

Commit

Permalink
misc: skip for sync PRs, remove issue opened check for pr validator (#…
Browse files Browse the repository at this point in the history
…6244)

* fix: skip for sync PRs, remove issue opened check for pr validator

* misc: retained old code and commented them instead deleting
  • Loading branch information
SATYAsasini authored Jan 2, 2025
1 parent 36e484f commit d13188c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ types:
- doc
- release
- misc
- sync
33 changes: 17 additions & 16 deletions .github/workflows/pr-issue-validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -140,32 +140,33 @@ 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
fi
# 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.
Expand Down

0 comments on commit d13188c

Please sign in to comment.