name: Sync Repo to Database on: workflow_dispatch: inputs: roadmap_slug: description: "The slug of the roadmap to sync (e.g., frontend, backend)" required: true jobs: sync-roadmap: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup pnpm@v11 uses: pnpm/action-setup@v4 with: version: 11 run_install: false - name: Setup Node.js Version 24 (LTS) uses: actions/setup-node@v4 with: node-version: 24 cache: 'pnpm' - name: Get all roadmap files id: roadmap-files run: | ROADMAP_DIR="roadmaps/${{ inputs.roadmap_slug }}" if [ ! -d "$ROADMAP_DIR" ]; then echo "Error: Roadmap directory '$ROADMAP_DIR' does not exist" exit 1 fi echo "Getting all files in $ROADMAP_DIR" ALL_FILES=$(find "$ROADMAP_DIR" -type f | tr '\n' ',') echo "Files to sync:" echo "$ALL_FILES" echo "files=$ALL_FILES" >> $GITHUB_OUTPUT - name: Install Dependencies run: | echo "Installing Dependencies" pnpm install - name: Run sync script run: | echo "Running sync script for roadmap: ${{ inputs.roadmap_slug }}" echo "Files: ${{ steps.roadmap-files.outputs.files }}" npm run sync:repo-to-database -- --files="${{ steps.roadmap-files.outputs.files }}" --secret=${{ secrets.GH_SYNC_SECRET }}