Update Cursor Download Links #8913
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Cursor Download Links | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' # Run hourly at minute 0 | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-links: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: oslook/cursor-download-hub | |
| token: ${{ secrets.API_TOKEN_GITHUB }} | |
| ref: main | |
| path: output/cursor-download-hub | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run update script | |
| run: bun src/update-cursor-links.ts | |
| - name: Run update script | |
| run: ./scripts/download_all_cursors.sh version-history.json | |
| - name: Check for changes | |
| id: git-check | |
| run: | | |
| git add README.md version-history.json cursor_products | |
| if ! git diff --staged --quiet; then | |
| echo "changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push if changed | |
| if: steps.git-check.outputs.changes == 'true' | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "GitHub Actions" | |
| git add README.md version-history.json cursor_products | |
| git commit -m "Update Cursor download links" | |
| git push | |
| - name: copy file | |
| run: cp -rf version-history.json output/cursor-download-hub/public/ | |
| - name: Pushes to another repository | |
| uses: cpina/github-action-push-to-another-repository@main | |
| env: | |
| API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
| with: | |
| source-directory: 'output/cursor-download-hub' | |
| destination-github-username: "oslook" | |
| destination-repository-name: 'cursor-download-hub' | |
| user-email: 41898282+github-actions[bot]@users.noreply.github.com | |
| user-name: github-actions[bot] | |
| commit-message: 'Auto updated' | |
| target-branch: main |