diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1661735854..c2edea9006 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -11,4 +11,4 @@ scripts/sql @prakarsh-dt @vikramdevtron @nishant-d @vivek-devtron scripts/utilities @prakarsh-dt @nishant-d @pawan-mehta-dt @vivek-devtron #Github Specific -.github/ @prakarsh-dt @nishant-d @pawan-mehta-dt @vikramdevtron +.github/ @prakarsh-dt @nishant-d @pawan-mehta-dt @vikramdevtron @tayalrishabh96 diff --git a/.github/workflows/pr-issue-validator.yaml b/.github/workflows/pr-issue-validator.yaml index a012d9983b..d333b7d77b 100644 --- a/.github/workflows/pr-issue-validator.yaml +++ b/.github/workflows/pr-issue-validator.yaml @@ -26,6 +26,7 @@ jobs: issues: write contents: read pull-requests: write + repository-projects: read steps: - name: Checkout repository uses: actions/checkout@v2 @@ -40,6 +41,16 @@ jobs: PRNUM: ${{ github.event.pull_request.number }} TITLE: ${{ github.event.pull_request.title }} run: | + + echo "base or target repo : ${{ github.event.pull_request.base.repo.full_name }}" + echo "head or source repo : ${{ github.event.pull_request.head.repo.full_name }}" + + if [[ ${{ github.event.pull_request.head.repo.full_name }} == ${{ github.event.pull_request.base.repo.full_name }} ]]; then + export forked=false + else + export forked=true + fi + set -x # Skip validation for documentation or chore PRs if [[ "$TITLE" =~ ^(doc:|docs:|chore:|misc:) ]]; then @@ -134,11 +145,19 @@ jobs: # Check if the issue is still open. 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 # 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."