Process plugin submission issues #398
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: Process plugin submission issues | |
| on: | |
| schedule: | |
| - cron: "7,37 * * * *" | |
| workflow_dispatch: | |
| inputs: | |
| only_issue: | |
| description: "Only process this Issue number (0 means all open submissions)" | |
| required: true | |
| default: 0 | |
| type: number | |
| review_limit: | |
| description: "Maximum number of new reviews to dispatch" | |
| required: true | |
| default: 5 | |
| type: number | |
| permissions: | |
| actions: write | |
| contents: read | |
| issues: write | |
| concurrency: | |
| group: submission-issue-intake | |
| cancel-in-progress: false | |
| jobs: | |
| scan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore the latest operational candidate ledger | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| mkdir -p data .candidate-state | |
| restored="" | |
| for run_id in $(gh run list --workflow sync-topic-plugins.yml --status success --limit 20 --json databaseId --jq '.[].databaseId'); do | |
| if gh run download "$run_id" --name topic-candidate-ledger --dir .candidate-state 2>/dev/null; then | |
| restored=$(find .candidate-state -name topic-candidates.json -print -quit) | |
| break | |
| fi | |
| done | |
| if [ -n "$restored" ]; then | |
| cp "$restored" data/topic-candidates.json | |
| else | |
| echo '{"candidates":[],"query":"topic:dsh-plugin","schema_version":1,"source_total":0}' > data/topic-candidates.json | |
| fi | |
| - name: Reconcile official plugin submission issues | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| ONLY_ISSUE: ${{ inputs.only_issue || 0 }} | |
| REVIEW_LIMIT: ${{ inputs.review_limit || 5 }} | |
| run: | | |
| args=( | |
| --issues | |
| --apply-published | |
| --handle-exceptions | |
| --queue-reviews | |
| --review-limit "$REVIEW_LIMIT" | |
| --output issue-intake.json | |
| ) | |
| if [[ "$ONLY_ISSUE" != "0" ]]; then | |
| args+=(--only-issue "$ONLY_ISSUE") | |
| fi | |
| python3 scripts/reconcile_submission_prs.py "${args[@]}" | |
| - name: Upload the intake ledger | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: submission-issue-intake-${{ github.run_id }} | |
| path: issue-intake.json | |
| if-no-files-found: error | |
| retention-days: 14 |