name: PR Label Analysis

on:
  pull_request:
    types: [opened]

permissions:
  contents: read

jobs:
  analyze:
    name: Analyze PR for labeling
    runs-on: ubuntu-latest
    
    steps:
      - name: Save PR metadata
        env:
          PR_NUMBER: ${{ github.event.pull_request.number }}
        run: |
          mkdir -p ./pr-metadata
          echo "${PR_NUMBER}" > ./pr-metadata/pr-number.txt
      
      - name: Upload PR metadata as artifact
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        with:
          name: pr-metadata-${{ github.event.pull_request.number }}
          path: pr-metadata/
          retention-days: 1