Verify Features #14
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: Verify Features | |
| on: | |
| # Weekly schedule - Sundays at 00:00 UTC | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| # Manual trigger with options | |
| workflow_dispatch: | |
| inputs: | |
| platform: | |
| description: 'Platform to verify (leave empty for all)' | |
| required: false | |
| type: string | |
| stale_only: | |
| description: 'Only verify stale features' | |
| required: false | |
| type: boolean | |
| default: false | |
| dry_run: | |
| description: 'Dry run (no issues/PRs created)' | |
| required: false | |
| type: boolean | |
| default: false | |
| max_features: | |
| description: 'Maximum features to verify' | |
| required: false | |
| type: number | |
| default: 50 | |
| jobs: | |
| verify: | |
| name: Verify Feature Data | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build verification arguments | |
| id: args | |
| run: | | |
| ARGS="" | |
| if [ -n "${{ inputs.platform }}" ]; then | |
| ARGS="$ARGS --platform ${{ inputs.platform }}" | |
| fi | |
| if [ "${{ inputs.stale_only }}" = "true" ]; then | |
| ARGS="$ARGS --stale-only" | |
| fi | |
| if [ "${{ inputs.dry_run }}" = "true" ]; then | |
| ARGS="$ARGS --dry-run" | |
| fi | |
| if [ -n "${{ inputs.max_features }}" ]; then | |
| ARGS="$ARGS --max ${{ inputs.max_features }}" | |
| else | |
| ARGS="$ARGS --max 50" | |
| fi | |
| ARGS="$ARGS --verbose" | |
| echo "args=$ARGS" >> $GITHUB_OUTPUT | |
| - name: Run feature verification | |
| id: verify | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| PERPLEXITY_API_KEY: ${{ secrets.PERPLEXITY_API_KEY }} | |
| XAI_API_KEY: ${{ secrets.XAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| node scripts/verify-features.js ${{ steps.args.outputs.args }} | |
| continue-on-error: true | |
| - name: Commit updated dates | |
| if: inputs.dry_run != true | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Check if there are changes to commit | |
| if git diff --quiet data/platforms/; then | |
| echo "No changes to commit" | |
| else | |
| git add data/platforms/ | |
| git commit -m "Update Checked/Verified dates [skip ci]" | |
| git push | |
| fi | |
| - name: Upload verification report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: verification-report | |
| path: .verification-reports/ | |
| retention-days: 30 | |
| - name: Check for required secrets | |
| if: steps.verify.outcome == 'failure' | |
| run: | | |
| echo "::warning::Verification may have failed due to missing API keys." | |
| echo "Ensure these secrets are configured:" | |
| echo " - GEMINI_API_KEY" | |
| echo " - PERPLEXITY_API_KEY" | |
| echo " - XAI_API_KEY" | |
| echo " - ANTHROPIC_API_KEY" | |
| # Daily staleness check (lightweight) | |
| staleness-check: | |
| name: Check for Stale Features | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'schedule' | |
| permissions: | |
| contents: read | |
| issues: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Check staleness | |
| id: staleness | |
| run: | | |
| # Simple staleness check without API calls | |
| node -e " | |
| const { findStaleFeatures } = require('./scripts/lib/parser'); | |
| const stale = findStaleFeatures(30); | |
| console.log('Found ' + stale.length + ' stale features'); | |
| if (stale.length > 0) { | |
| console.log('\nStale features:'); | |
| for (const { platform, feature, daysSinceChecked } of stale.slice(0, 10)) { | |
| console.log(' - ' + platform.name + ' → ' + feature.name + ' (' + daysSinceChecked + ' days)'); | |
| } | |
| if (stale.length > 10) { | |
| console.log(' ... and ' + (stale.length - 10) + ' more'); | |
| } | |
| } | |
| // Output for GitHub Actions | |
| const fs = require('fs'); | |
| fs.appendFileSync(process.env.GITHUB_OUTPUT, 'count=' + stale.length + '\n'); | |
| " | |
| - name: Create staleness issue | |
| if: steps.staleness.outputs.count > 10 | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Create label if it doesn't exist (ignore errors) | |
| gh label create "verification-needed" --color "0e8a16" --description "Feature needs verification" 2>/dev/null || true | |
| gh issue create \ | |
| --title "[Automated] ${{ steps.staleness.outputs.count }} features need verification" \ | |
| --body "The weekly staleness check found ${{ steps.staleness.outputs.count }} features that haven't been verified in over 7 days. | |
| Please run the full verification workflow or manually review these features. | |
| To run verification: | |
| 1. Go to Actions → Verify Features | |
| 2. Click 'Run workflow' | |
| 3. Optionally check 'Only verify stale features' | |
| --- | |
| *This issue was automatically created by the staleness check.*" \ | |
| --label "verification-needed" |