name: 🔄 Sync Releases
on:
  workflow_dispatch:
    inputs:
      package:
        description: Package to sync
        default: wxt
        type: choice
        options:
          - analytics
          - auto-icons
          - i18n
          - is-background
          - module-react
          - module-solid
          - module-svelte
          - module-vue
          - runner
          - storage
          - webextension-polyfill
          - wxt

permissions:
  contents: read

jobs:
  sync:
    name: Sync Releases
    runs-on: ubuntu-22.04
    permissions:
      contents: write
    steps:
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Setup
        uses: ./.github/actions/setup
        with:
          installArgs: --ignore-scripts

      - name: Sync Releases
        run: pnpm tsx scripts/sync-releases.ts ${{ inputs.package }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
