name: 'Upload SCIP to Sourcegraph'
on:
  push:
    branches:
      - main
  pull_request:
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 24.22.2
          cache: yarn
      - run: corepack enable
      - run: yarn install --frozen-lockfile
      - run: yarn global add @sourcegraph/src
      - run: yarn tsx src/main.ts index

      - name: Upload SCIP to S2
        run: src code-intel upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress
        env:
          SRC_ENDPOINT: https://sourcegraph.sourcegraph.com/
          SRC_ACCESS_TOKEN: ${{ secrets.SRC_ACCESS_TOKEN_S2 }}
