|
26 | 26 | issues: write
|
27 | 27 | contents: read
|
28 | 28 | pull-requests: write
|
| 29 | + repository-projects: read |
29 | 30 | steps:
|
30 | 31 | - name: Checkout repository
|
31 | 32 | uses: actions/checkout@v2
|
|
40 | 41 | PRNUM: ${{ github.event.pull_request.number }}
|
41 | 42 | TITLE: ${{ github.event.pull_request.title }}
|
42 | 43 | run: |
|
| 44 | + |
| 45 | + echo "base or target repo : ${{ github.event.pull_request.base.repo.full_name }}" |
| 46 | + echo "head or source repo : ${{ github.event.pull_request.head.repo.full_name }}" |
| 47 | +
|
| 48 | + if [[ ${{ github.event.pull_request.head.repo.full_name }} == ${{ github.event.pull_request.base.repo.full_name }} ]]; then |
| 49 | + export forked=false |
| 50 | + else |
| 51 | + export forked=true |
| 52 | + fi |
| 53 | +
|
43 | 54 | set -x
|
44 | 55 | # Skip validation for documentation or chore PRs
|
45 | 56 | if [[ "$TITLE" =~ ^(doc:|docs:|chore:|misc:) ]]; then
|
@@ -134,11 +145,19 @@ jobs:
|
134 | 145 | # Check if the issue is still open.
|
135 | 146 | if [[ "$issue_status" == open ]]; then
|
136 | 147 | echo "Issue #$issue_num is opened."
|
| 148 | + if [[ $forked == true ]]; then |
| 149 | + echo "PR:Ready-to-Review, exiting gracefully" |
| 150 | + exit 0 |
| 151 | + fi |
137 | 152 | # Remove the 'Issue-verification-failed' label (if present) and add 'Ready-to-Review'.
|
138 | 153 | gh pr edit $PRNUM --remove-label "PR:Issue-verification-failed"
|
139 | 154 | gh pr edit $PRNUM --add-label "PR:Ready-to-Review"
|
140 | 155 | else
|
141 | 156 | echo "Issue #$issue_num is closed. Please link an open issue to proceed."
|
| 157 | + if [[ $forked == true ]]; then |
| 158 | + echo "PR:Ready-to-Review, exiting gracefully" |
| 159 | + exit 0 |
| 160 | + fi |
142 | 161 | # Add a comment to the PR indicating the issue is not linked correctly.
|
143 | 162 | gh pr comment $PRNUM --body "PR is linked to a closed issue. Please link an open issue to proceed."
|
144 | 163 |
|
|
0 commit comments