Backlog cleanup: pagination, lint hook, dead code #4
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: Cleanup Review Worksheets | |
| on: | |
| pull_request: | |
| types: [closed] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| cleanup: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure git | |
| run: | | |
| git config user.name "P.R. PhiedBach" | |
| git config user.email "phiedbach@bikeshed.dungeon" | |
| - name: Remove review artifacts | |
| run: | | |
| pr_number=${{ github.event.pull_request.number }} | |
| review_dir="docs/code-reviews/PR${pr_number}" | |
| if [ -d "$review_dir" ]; then | |
| git rm -r "$review_dir" | |
| fi | |
| # Remove any rejected-suggestion docs tied to this PR number | |
| git ls-files "docs/code-reviews/rejected-suggestions/*_${pr_number}_*.md" | xargs -r git rm | |
| - name: Commit cleanup | |
| run: | | |
| if git diff --cached --quiet; then | |
| echo "No review artifacts to delete; skipping commit." | |
| exit 0 | |
| fi | |
| git commit -m "coda(PR#${{ github.event.pull_request.number }}): archive rehearsal notes" | |
| - name: Push cleanup commit | |
| run: | | |
| git push |