name: Discontinue Legacy Main Intake on: workflow_dispatch: inputs: close_existing_issues: description: Close all currently open issues required: true type: boolean default: true close_existing_pull_requests: description: Close all currently open pull requests for the discontinued legacy app required: true type: boolean default: true dry_run: description: Log actions without posting comments or closing items required: true type: boolean default: false issues: types: - opened - reopened pull_request_target: types: - opened - reopened permissions: contents: read issues: write pull-requests: write jobs: bulk-close: if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - name: Close existing legacy issues and pull requests uses: actions/github-script@v7 env: CLOSE_EXISTING_ISSUES: ${{ inputs.close_existing_issues }} CLOSE_EXISTING_PULL_REQUESTS: ${{ inputs.close_existing_pull_requests }} DRY_RUN: ${{ inputs.dry_run }} with: script: | const owner = context.repo.owner; const repo = context.repo.repo; const dryRun = process.env.DRY_RUN === 'true'; const closeExistingIssues = process.env.CLOSE_EXISTING_ISSUES === 'true'; const closeExistingPullRequests = process.env.CLOSE_EXISTING_PULL_REQUESTS === 'true'; const issueComment = [ 'Thanks for taking the time to report this.', '', 'The current Nuvio Mobile app is being discontinued in favor of a full Compose Multiplatform rewrite. Because of that, issue tracking for the legacy React Native codebase is being closed out.', '', 'This does not mean your report was ignored. It means we are no longer planning fixes against the outgoing app, and we want to avoid leaving old tickets open without active follow-up.', '', 'If the same problem still exists once the new version enters public beta, please open a fresh issue for the rewrite at that time.', '', 'Thank you for the report and for helping improve Nuvio.' ].join('\n'); const pullRequestComment = [ 'Thanks for the pull request and for the time put into it.', '', 'The current Nuvio Mobile app is being discontinued in favor of a full Compose Multiplatform rewrite, so changes against the legacy React Native codebase are no longer being reviewed or merged.', '', 'For that reason, this pull request is being closed as part of the wind-down of the old app.', '', 'Pull requests for the rewrite are not open yet. Once contribution intake is ready for the new codebase, maintainers will announce it clearly.', '', 'Thank you again for the contribution and for supporting the project.' ].join('\n'); async function commentAndClose(issueNumber, body, itemType) { if (dryRun) { core.info(`[dry-run] Would comment on and close ${itemType} #${issueNumber}`); return; } await github.rest.issues.createComment({ owner, repo, issue_number: issueNumber, body, }); await github.rest.issues.update({ owner, repo, issue_number: issueNumber, state: 'closed', }); } if (closeExistingIssues) { const issues = await github.paginate(github.rest.issues.listForRepo, { owner, repo, state: 'open', per_page: 100, }); for (const issue of issues) { if (issue.pull_request) { continue; } await commentAndClose(issue.number, issueComment, 'issue'); } } if (closeExistingPullRequests) { const pullRequests = await github.paginate(github.rest.pulls.list, { owner, repo, state: 'open', per_page: 100, }); for (const pullRequest of pullRequests) { await commentAndClose(pullRequest.number, pullRequestComment, 'pull request'); } } auto-close-issue: if: github.event_name == 'issues' runs-on: ubuntu-latest steps: - name: Close new issues for the discontinued legacy app uses: actions/github-script@v7 with: script: | const issueNumber = context.payload.issue.number; const owner = context.repo.owner; const repo = context.repo.repo; const issueComment = [ 'Thanks for taking the time to report this.', '', 'The current Nuvio Mobile app is being discontinued in favor of a full Compose Multiplatform rewrite. Because of that, issue tracking for the legacy React Native codebase is being closed out.', '', 'If the same problem still exists once the new version enters public beta, please open a fresh issue for the rewrite at that time.', '', 'Thank you for the report and for helping improve Nuvio.' ].join('\n'); await github.rest.issues.createComment({ owner, repo, issue_number: issueNumber, body: issueComment, }); await github.rest.issues.update({ owner, repo, issue_number: issueNumber, state: 'closed', }); auto-close-pull-request: if: github.event_name == 'pull_request_target' runs-on: ubuntu-latest steps: - name: Close new pull requests for the legacy app uses: actions/github-script@v7 with: script: | const issueNumber = context.payload.pull_request.number; const owner = context.repo.owner; const repo = context.repo.repo; const pullRequestComment = [ 'Thanks for the pull request and for the time put into it.', '', 'The current Nuvio Mobile app is being discontinued in favor of a full Compose Multiplatform rewrite, so changes against the legacy React Native codebase are no longer being reviewed or merged.', '', 'For that reason, this pull request is being closed as part of the wind-down of the old app.', '', 'Pull requests for the rewrite are not open yet. Once contribution intake is ready for the new codebase, maintainers will announce it clearly.', '', 'Thank you again for the contribution and for supporting the project.' ].join('\n'); await github.rest.issues.createComment({ owner, repo, issue_number: issueNumber, body: pullRequestComment, }); await github.rest.issues.update({ owner, repo, issue_number: issueNumber, state: 'closed', });