Bump juliangruber/approve-pull-request-action from c530832d4d346c597332e20e03605aa94fa150a8 to 1fe354e1d225ae05f1a4132396b82e7b930d417d #305
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Triage new issue comments | |
| # **What it does**: | |
| # **Why we have it**: | |
| # **Who does it impact**: | |
| on: | |
| issue_comment: | |
| types: | |
| - created | |
| permissions: | |
| issues: write | |
| jobs: | |
| triage-issue-comments: | |
| if: ${{ github.repository == 'github/docs' && !github.event.issue.pull_request }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check if the event originated from a team member | |
| uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d | |
| id: is-internal-contributor | |
| with: | |
| result-encoding: string | |
| script: | | |
| const repo = context.payload.repository.name | |
| const org = context.payload.repository.owner.login | |
| const actor = context.actor | |
| let collaboratorStatus = '' | |
| try { | |
| collaboratorStatus = await github.request('GET /repos/{owner}/{repo}/collaborators/{username}', { | |
| owner: org, | |
| repo: repo, | |
| username: actor | |
| }) | |
| console.log(`This issue was commented on by a Hubber.`) | |
| return 'true' | |
| } catch (error) { | |
| console.log(`This issue was commented on by an external contributor.`) | |
| return 'false' | |
| } | |
| - name: Label issues with new comments with 'triage' | |
| uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 | |
| if: ${{ steps.is-internal-contributor.outputs.result == 'false' }} | |
| with: | |
| add-labels: 'triage' | |
| ignore-if-labeled: true |