copilot-review-cleanup #2868
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
| # | |
| # Copyright 2022 The Dapr Authors | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # | |
| # Runs hourly and closes any open mirror PRs (branches matching copilot/pr-*) | |
| # that were created more than 3 hours ago. Also deletes the mirror branch and | |
| # posts a cleanup notice on the original PR. | |
| name: copilot-review-cleanup | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' # Every hour | |
| workflow_dispatch: {} # Allow manual trigger for testing | |
| permissions: | |
| contents: read | |
| jobs: | |
| cleanup: | |
| name: cleanup-mirror-prs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Clean up stale Copilot review mirror PRs | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.DAPR_BOT_TOKEN }} | |
| script: | | |
| const script = require('./.github/scripts/copilot_review_cleanup.js') | |
| await script({ github, context }) |