1
0
mirror of synced 2025-12-19 09:57:42 -05:00
Files
docs/.github/workflows/triage-issue-comments.yml
dependabot[bot] 3e333183fb Bump actions/checkout from 5.0.0 to 6.0.1 (#58937)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 23:37:47 +00:00

75 lines
2.4 KiB
YAML

name: Triage new issue comments
# **What it does**: Adds label triage to new issue comments in the open source repository.
# **Why we have it**: Update open source project board for review.
# **Who does it impact**: Docs open source.
on:
issue_comment:
types:
- created
permissions:
contents: read
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@ed597411d8f924073f98dfc5c65a23a2325f34cd
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: Check out repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: ./.github/actions/node-npm-setup
- name: Check issue exists
id: exists
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }}
run: |
if gh issue view $ISSUE_URL > /dev/null 2>&1
then
echo "exists=y" >> $GITHUB_OUTPUT
else
echo "exists=n" >> $GITHUB_OUTPUT
fi
- name: Label issues with new comments with 'triage'
uses: ./.github/actions/labeler
if: ${{ steps.is-internal-contributor.outputs.result == 'false' && steps.exists.outputs.exists == 'y' }}
with:
addLabels: 'triage'
ignoreIfLabeled: true
- uses: ./.github/actions/slack-alert
if: ${{ failure() }}
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}