Repository navigation
feat: new action review-post-release-pr #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
4e1a7c3
refactor: rename example pre-review-pr workflow
kelly-sovacool 0309b77
fix(pre-commit-review): post failure as comment, do not request changes
kelly-sovacool 1cd3e95
docs: update CHANGELOG.md
kelly-sovacool 1eab3a8
chore: ignore uv.lock
kelly-sovacool a8af359
feat: new action review-post-release-pr
kelly-sovacool fec2396
docs: update CHANGELOG.md for #227
kelly-sovacool f05f388
Merge branch 'main' into iss-209
kelly-sovacool 57e43db
ci: 🤖 render readme & format everything with pre-commit
ccbr-bot[bot] 4500420
test: cover remaining branches in post_release_pr module
kelly-sovacool 61d9706
docs(review-pre-commit-pr): simplify example to a minimal standalone …
kelly-sovacool 6639359
docs: minor improvement to example
kelly-sovacool 086393e
ci: 🤖 render readme & format everything with pre-commit
ccbr-bot[bot] fdc6c9b
fix(review-post-release-pr): address GitHub Copilot review feedback o…
kelly-sovacool f03714a
ci: 🤖 render readme & format everything with pre-commit
ccbr-bot[bot] ff1e426
fix(review-post-release-pr): avoid duplicate human-review comments/re…
kelly-sovacool a3910c1
fix(review-post-release-pr): address second round of Copilot review f…
kelly-sovacool c5f461a
ci: 🤖 render readme & format everything with pre-commit
ccbr-bot[bot] 05f8937
ci: use new pre-review action
kelly-sovacool f0de2df
chore: Merge branch 'iss-209' of github.com:CCBR/actions into iss-209
kelly-sovacool d343bf1
fix(review-pr): require bot sender for pull_request synchronize trigger
kelly-sovacool 5d9b9d4
fix(review-pr): pass action inputs via env instead of embedding in py…
kelly-sovacool 9d5edc7
fix(post-release-pr): reject codemeta bump that drops a date field
kelly-sovacool 64b481d
docs(pr-review): clarify get_last_workflow_run_actor is best-effort
kelly-sovacool 275718c
docs(changelog): record review-pr security hardening (#227)
kelly-sovacool 8605fef
ci: 🤖 render readme & format everything with pre-commit
ccbr-bot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| name: pre-review-pr | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - review_requested | ||
| - synchronize | ||
| # Manually re-scan open PRs for any that meet the pre-commit.ci autoupdate criteria | ||
| workflow_dispatch: | ||
| inputs: | ||
| force-review: | ||
| description: Re-submit reviews for PRs that already have an approval | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| permissions: | ||
| actions: write | ||
| contents: write | ||
| issues: write | ||
| pull-requests: write | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| find-prec-prs: | ||
| # Only needed when manually dispatched; the pull_request event already has a single PR to act on | ||
| if: github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| pr-numbers: ${{ steps.search.outputs.pr-numbers }} | ||
| steps: | ||
| - name: Search for open pre-commit.ci autoupdate PRs | ||
| id: search | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| pr_numbers=$(gh pr list \ | ||
| --repo "${{ github.repository }}" \ | ||
| --state open \ | ||
| --json number,title,author \ | ||
| --jq '[.[] | select(.title == "[pre-commit.ci] pre-commit autoupdate" and .author.is_bot)] | map(.number)') | ||
| echo "pr-numbers=${pr_numbers}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| review-pre-commit-pr: | ||
| needs: [find-prec-prs] | ||
| runs-on: ubuntu-latest | ||
| container: nciccbr/ccbr_actions:latest | ||
| # Only run for pre-commit.ci autoupdate PRs or when ccbr-bot[bot] is requested as a reviewer | ||
| if: > | ||
| always() && | ||
| ( | ||
| ( | ||
| github.event_name == 'pull_request' && | ||
| github.event.pull_request.title == '[pre-commit.ci] pre-commit autoupdate' && | ||
| ( | ||
| (github.event.action == 'opened' && github.event.sender.type == 'Bot') || | ||
| (github.event.action == 'review_requested' && github.event.requested_reviewer.login == 'ccbr-bot[bot]') | ||
| ) | ||
| ) | ||
| || (github.event_name == 'workflow_dispatch' && needs.find-prec-prs.outputs.pr-numbers != '[]') | ||
| ) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| pr-number: ${{ github.event_name == 'workflow_dispatch' && fromJson(needs.find-prec-prs.outputs.pr-numbers) || fromJson(format('[{0}]', github.event.pull_request.number)) }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - name: Generate CCBR-bot token | ||
| id: generate-token | ||
| uses: actions/create-github-app-token@v3 | ||
| with: | ||
| client-id: ${{ vars.CCBR_BOT_APP_ID }} | ||
| private-key: ${{ secrets.CCBR_BOT_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
| permission-contents: write | ||
| permission-issues: write | ||
| permission-pull-requests: write | ||
| - uses: CCBR/actions/review-pre-commit-pr@main | ||
| with: | ||
| github-token: ${{ steps.generate-token.outputs.token }} | ||
| pr-number: ${{ matrix.pr-number }} | ||
| repo: ${{ github.repository }} | ||
| reviewer: CCBR/adminteam | ||
| force-review: ${{ github.event.action == 'review_requested' || inputs.force-review || false }} | ||
|
|
||
| find-post-release-prs: | ||
| # Only needed when manually dispatched; the pull_request event already has a single PR to act on | ||
| if: github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| pr-numbers: ${{ steps.search.outputs.pr-numbers }} | ||
| steps: | ||
| - name: Search for open post-release cleanup PRs | ||
| id: search | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| pr_numbers=$(gh pr list \ | ||
| --repo "${{ github.repository }}" \ | ||
| --state open \ | ||
| --json number,title,author \ | ||
| --jq '[.[] | select(.title | startswith("chore: post-release cleanup for")) | select(.author.is_bot)] | map(.number)') | ||
| echo "pr-numbers=${pr_numbers}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| review-post-release-pr: | ||
| needs: [find-post-release-prs] | ||
| runs-on: ubuntu-latest | ||
| container: nciccbr/ccbr_actions:latest | ||
| # Only run for post-release cleanup PRs or when ccbr-bot[bot] is requested as a reviewer | ||
| if: > | ||
| always() && | ||
| ( | ||
| ( | ||
| github.event_name == 'pull_request' && | ||
| startsWith(github.event.pull_request.title, 'chore: post-release cleanup for') && | ||
| ( | ||
| ((github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.sender.type == 'Bot') || | ||
| (github.event.action == 'review_requested' && github.event.requested_reviewer.login == 'ccbr-bot[bot]') | ||
| ) | ||
| ) | ||
| || (github.event_name == 'workflow_dispatch' && needs.find-post-release-prs.outputs.pr-numbers != '[]') | ||
| ) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| pr-number: ${{ github.event_name == 'workflow_dispatch' && fromJson(needs.find-post-release-prs.outputs.pr-numbers) || fromJson(format('[{0}]', github.event.pull_request.number)) }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - name: Generate CCBR-bot token | ||
| id: generate-token | ||
| uses: actions/create-github-app-token@v3 | ||
| with: | ||
| client-id: ${{ vars.CCBR_BOT_APP_ID }} | ||
| private-key: ${{ secrets.CCBR_BOT_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
| permission-actions: write | ||
| permission-contents: write | ||
| permission-issues: write | ||
| permission-pull-requests: write | ||
| - uses: CCBR/actions/review-post-release-pr@main | ||
| with: | ||
| github-token: ${{ steps.generate-token.outputs.token }} | ||
| pr-number: ${{ matrix.pr-number }} | ||
| repo: ${{ github.repository }} | ||
| force-review: ${{ github.event.action == 'review_requested' || inputs.force-review || false }} |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,6 +177,9 @@ cython_debug/ | |
| .pixi/* | ||
| !.pixi/config.toml | ||
|
|
||
| # uv | ||
| uv.lock | ||
|
|
||
| # genAI | ||
| .github/prompts/ | ||
| .github/plans/ | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.