chore(deps-dev): Bump typescript in the dev-dependencies group #92
Workflow file for this run
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: Dependency Updates | ||
| on: | ||
| schedule: | ||
| # Run weekly on Sunday at 2 AM UTC | ||
| - cron: '0 2 * * 0' | ||
| workflow_dispatch: # Allow manual triggering | ||
| env: | ||
| NODE_VERSION: '20' | ||
| jobs: | ||
| # Check for dependency updates | ||
| check-updates: | ||
| name: Check for Dependency Updates | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: ./website | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'npm' | ||
| cache-dependency-path: 'website/package-lock.json' | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Check for npm updates | ||
| id: npm-updates | ||
| run: | | ||
| # Check for outdated dependencies | ||
| npm outdated --json > outdated.json || true | ||
| # Count updates | ||
| UPDATES=$(jq 'length' outdated.json 2>/dev/null || echo "0") | ||
| echo "updates_count=$UPDATES" >> $GITHUB_OUTPUT | ||
| # Create summary | ||
| if [ "$UPDATES" -gt "0" ]; then | ||
| echo "Found $UPDATES outdated dependencies" | ||
| jq -r 'to_entries[] | "\(.key): \(.value.current) -> \(.value.latest)"' outdated.json | ||
| else | ||
| echo "All dependencies are up to date" | ||
| fi | ||
| - name: Create dependency update report | ||
| run: | | ||
| echo "# Dependency Update Report - $(date)" > dependency-report.md | ||
| echo "## Summary" >> dependency-report.md | ||
| echo "- Repository: ${{ github.repository }}" >> dependency-report.md | ||
| echo "- Branch: ${{ github.ref }}" >> dependency-report.md | ||
| echo "- Scan Date: $(date)" >> dependency-report.md | ||
| echo "- Outdated Dependencies: ${{ steps.npm-updates.outputs.updates_count }}" >> dependency-report.md | ||
| echo "" >> dependency-report.md | ||
| if [ -f outdated.json ]; then | ||
| echo "## Outdated Dependencies" >> dependency-report.md | ||
| echo "" >> dependency-report.md | ||
| echo "| Package | Current | Latest | Type |" >> dependency-report.md | ||
| echo "|---------|---------|--------|------|" >> dependency-report.md | ||
| jq -r 'to_entries[] | "| \(.key) | \(.value.current) | \(.value.latest) | \(.value.type) |"' outdated.json >> dependency-report.md | ||
| else | ||
| echo "✅ All dependencies are up to date!" >> dependency-report.md | ||
| fi | ||
| echo "" >> dependency-report.md | ||
| echo "## Security Advisories" >> dependency-report.md | ||
| echo "Run security scan workflow for detailed vulnerability information." >> dependency-report.md | ||
| mkdir -p reports | ||
| mv dependency-report.md reports/ | ||
| mv outdated.json reports/ 2>/dev/null || true | ||
| - name: Upload dependency report | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dependency-reports | ||
| path: | | ||
| website/reports/ | ||
| retention-days: 30 | ||
| - name: Create issue for major updates | ||
| if: steps.npm-updates.outputs.updates_count != '0' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| // Check if there are major updates needed | ||
| const fs = require('fs'); | ||
| let outdatedData = {}; | ||
| try { | ||
| outdatedData = JSON.parse(fs.readFileSync('website/reports/outdated.json', 'utf8')); | ||
| } catch (e) { | ||
| console.log('No outdated.json file found'); | ||
| return; | ||
| } | ||
| // Filter for major updates (where current major != latest major) | ||
| const majorUpdates = Object.entries(outdatedData).filter(([pkg, info]) => { | ||
| const currentMajor = info.current.split('.')[0]; | ||
| const latestMajor = info.latest.split('.')[0]; | ||
| return currentMajor !== latestMajor; | ||
| }); | ||
| if (majorUpdates.length > 0) { | ||
| const issueBody = `# Major Dependency Updates Needed | ||
| **Repository:** ${context.repo.owner}/${context.repo.repo} | ||
| **Scan Date:** ${new Date().toISOString()} | ||
| **Total Major Updates:** ${majorUpdates.length} | ||
| ## Packages Requiring Major Updates: | ||
| ${majorUpdates.map(([pkg, info]) => `- **${pkg}**: ${info.current} → ${info.latest} (${info.type})`).join('\n')} | ||
| ## Next Steps: | ||
| 1. Review each major update for breaking changes | ||
| 2. Test updates in a staging environment | ||
| 3. Update dependencies incrementally | ||
| 4. Run full test suite after updates | ||
| ## Automated Update Options: | ||
| - Use \`npm update\` for minor/patch updates | ||
| - Create PR with \`npm install package@latest\` for major updates | ||
| - Run security scans after updates | ||
| --- | ||
| *This issue was automatically generated by the Dependency Updates workflow.*`; | ||
| // Check if similar issue already exists | ||
| const { data: issues } = await github.rest.issues.listForRepo({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| state: 'open', | ||
| labels: ['dependencies', 'major-update'] | ||
| }); | ||
| const existingIssue = issues.find(issue => | ||
| issue.title.includes('Major Dependency Updates Needed') | ||
| ); | ||
| if (!existingIssue) { | ||
| await github.rest.issues.create({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| title: '🔔 Major Dependency Updates Needed', | ||
| body: issueBody, | ||
| labels: ['dependencies', 'major-update', 'automated'] | ||
| }); | ||
| } | ||
| } | ||
| # Auto-update dependencies (optional - creates PR) | ||
| auto-update: | ||
| name: Auto-update Dependencies | ||
| runs-on: ubuntu-latest | ||
| needs: check-updates | ||
| if: ${{ needs.check-updates.outputs.updates_count != '0' && github.event_name == 'workflow_dispatch' }} | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'npm' | ||
| cache-dependency-path: 'website/package-lock.json' | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Update npm dependencies | ||
| run: | | ||
| # Update all dependencies to latest compatible versions | ||
| npx npm-check-updates -u | ||
| # Install updated dependencies | ||
| npm install | ||
| # Run tests to ensure updates don't break anything | ||
| npm run test || echo "Tests failed - manual review needed" | ||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@v5 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| commit-message: 'chore(deps): update dependencies' | ||
| title: '🔧 Dependency Updates' | ||
| body: | | ||
| ## Automated Dependency Updates | ||
| This PR updates project dependencies to their latest compatible versions. | ||
| **Changes:** | ||
| - Updated npm packages | ||
| - Regenerated package-lock.json | ||
| **Testing:** | ||
| - [ ] Run `npm test` to verify functionality | ||
| - [ ] Deploy to staging environment | ||
| - [ ] Check for any breaking changes | ||
| **Notes:** | ||
| - Created automatically by Dependency Updates workflow | ||
| - Review changelogs for major version updates | ||
| - Run security scans after merging | ||
| --- | ||
| *Auto-generated by GitHub Actions* | ||
| branch: chore/dependency-updates | ||
| delete-branch: true | ||
| labels: dependencies, automated | ||