name: Issue Comment Created Triage

on:
  issue_comment:
    types: [created]

permissions:
  contents: read

jobs:
  issue_comment_triage:
    permissions:
      contents: read  # for actions/checkout to fetch code
      issues: write  # for actions-ecosystem/action-remove-labels to remove issue labels
    if: ${{contains(github.event.issue.labels.*.name, 'waiting-reply') || contains(github.event.issue.labels.*.name, 'stale')}}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
      - uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
        with:
          github_token: "${{ secrets.GITHUB_TOKEN }}"
          labels: |
            stale
            waiting-reply
