name: Triage new issue comments on: issue_comment: types: - created jobs: triage-issue-comments: if: github.repository == 'github/docs' && github.event.issue.pull_request == null runs-on: ubuntu-latest steps: - name: Check if the event originated from a team member uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 id: is-internal-contributor with: github-token: ${{secrets.GITHUB_TOKEN}} 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: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e if: (steps.is-internal-contributor.outputs.result == 'false') with: repo-token: '${{ secrets.GITHUB_TOKEN }}' add-labels: 'triage' - name: Triage to project board uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9 with: action-token: ${{ secrets.GITHUB_TOKEN }} project-url: 'https://github.com/github/docs/projects/1' column-name: 'Triage'