name: Add issues to OSS Big Tent team project
on:
  issues:
    types:
      - opened
  pull_request:
    types:
      - opened

permissions:
  contents: read
  id-token: write

jobs:
  add-to-project:
    name: Add issue to project
    runs-on: ubuntu-latest
    steps:
      - id: get-github-token
        uses: grafana/shared-workflows/actions/create-github-app-token@ae92934a14a48b94494dbc06d74a81d47fe08a40 # create-github-app-token/v0.2.2
        with:
          github_app: grafana-oss-big-tent
      - name: Add to project
        uses: actions/add-to-project@main
        with:
          project-url: https://github.com/orgs/grafana/projects/457
          github-token: ${{ steps.get-github-token.outputs.token }}
