Changeset 59169
- Timestamp:
- 10/04/2024 03:35:13 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/pull-request-comments.yml
r58939 r59169 4 4 on: 5 5 pull_request_target: 6 types: [ 'opened' ]6 types: [ 'opened', 'synchronize', 'reopened', 'edited' ] 7 7 workflow_run: 8 8 workflows: [ 'Test Build Processes' ] … … 165 165 github.rest.issues.createComment( commentInfo ); 166 166 167 # Leaves a comment on a pull request when no Trac ticket is included in the pull request description.167 # Manages comments reminding contributors to include a Trac ticket link when opening a pull request. 168 168 trac-ticket-check: 169 name: Comment on a pull request when no Trac ticket is included169 name: Manage Trac ticket reminders for pull requests 170 170 runs-on: ubuntu-latest 171 171 permissions: … … 174 174 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request_target' && ! github.event.pull_request.draft && github.event.pull_request.state == 'open' }} 175 175 steps: 176 - name: Check for Trac ticket and comment if missing176 - name: Check for Trac ticket and manage comment 177 177 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 178 178 with: … … 184 184 const comments = ( await github.rest.issues.listComments( { owner, repo, issue_number: number } ) ).data; 185 185 186 const hasMissingTicketComment = comments.some( comment => 187 comment.user.type === 'Bot' && comment.body.includes( 'Trac Ticket Missing' ) 188 ); 189 190 if ( hasMissingTicketComment ) return; 186 const hasMissingTicketComment = comments.find( comment => comment.user.type === 'Bot' && comment.body.includes( 'Trac Ticket Missing' ) ); 187 188 if ( hasMissingTicketComment ) { 189 // Trac ticket link found, delete existing "Trac Ticket Missing" comment. 190 await github.rest.issues.deleteComment( { owner, repo, comment_id: hasMissingTicketComment.id } ); 191 return; 192 } 191 193 192 194 // No comment was found. Create one.
Note: See TracChangeset
for help on using the changeset viewer.