# Rule description: If an issue author updates or comments on an issue while it is not active and has not been closed, the inactive tag will be removed
name: Issue Remove Inactive

on:
  issues:
    types: [edited]
  issue_comment:
    types: [created, edited]

env: # Set environment variables
  TZ: Asia/Shanghai #Time zone (setting the time zone allows the 'Last Updated' on the page to use the time zone)

permissions:
  contents: read

jobs:
  issue-remove-inactive:
    permissions:
      issues: write  # for actions-cool/issues-helper to update issues
     # pull-requests: write # for actions-cool/issues-helper to update PRs
    runs-on: ubuntu-latest
    steps:
      - name: remove inactive
        if: github.event.issue.state == 'open'
        uses: actions-cool/issues-helper@v3
        with:
          actions: 'remove-labels'
          issue-number: ${{ github.event.issue.number }}
          labels: 'inactive'
