name: 'Prepare new issue'
on:
  issues:
    types: [opened]

jobs:
  prepare-new-issue:
    runs-on: ubuntu-latest
    if: ${{ github.repository_owner == 'open-telemetry' }}
    steps:
      - uses: actions/checkout@v4

      - name: Run update permissions
        run: chmod +x ./.github/workflows/scripts/prepare-new-issue.sh

      - name: Run prepare-new-issue.sh
        run: ./.github/workflows/scripts/prepare-new-issue.sh
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          ISSUE: ${{ github.event.issue.number }}
          BODY: ${{ github.event.issue.body }}
          OPENER: ${{ github.event.issue.user.login }}
