name: 'GitHub: Issue Opened'
on:
  issues:
    types: [labeled]

# Keep these permissions in sync with the reusable workflow referenced below.
permissions:
  contents: write
  issues: write
  pull-requests: write

jobs:
  run:
    if: github.event.label.name == 'agent'
    uses: __UPSTREAM_REPO__/.github/workflows/gh-github-issue-opened.yml@main
    secrets:
      POE_CODE_AGENT_APP_ID: ${{ secrets.POE_CODE_AGENT_APP_ID }}
      POE_CODE_AGENT_PRIVATE_KEY: ${{ secrets.POE_CODE_AGENT_PRIVATE_KEY }}
      POE_API_KEY: ${{ secrets.POE_API_KEY }}
    with:
      ISSUE_NUMBER: ${{ github.event.issue.number }}
      ISSUE_TITLE: ${{ github.event.issue.title }}
      ISSUE_BODY: ${{ github.event.issue.body }}
      COMMENT_AUTHOR_ASSOCIATION: ${{ github.event.issue.author_association }}
      GITHUB_REPOSITORY: ${{ github.repository }}
