-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add codex auto review gh action #1904
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
Open
neodix42
wants to merge
13
commits into
ton-blockchain:testnet
Choose a base branch
from
neodix42:add-codex-auto-review
base: testnet
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+99
−0
Open
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3aa98a7
automatically add ""@codex review" comment to PRs
neodix42 07c15c9
Merge branch 'add-codex-auto-review' into testnet
neodix42 f2addc4
add more permissions to codex review job
neodix42 89d7005
trigger automatic codex review only on specified gh users
neodix42 446c70d
trigger automatic codex review when the review is submitted
neodix42 ae85e6e
add more permissions to codex review job
neodix42 17a5e7d
trigger automatic codex review only on specified gh users
neodix42 a492c35
trigger automatic codex review when the review is submitted
neodix42 34429b0
Merge remote-tracking branch 'origin/add-codex-auto-review' into add-…
neodix42 4ba8fec
rework codex auto review
neodix42 c281fac
rework codex auto review
neodix42 7d33a6e
rework codex auto review for PRs from forks
neodix42 0781fc1
fix based on a review
neodix42 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,99 @@ | ||
| name: Codex auto review | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
| pull_request_review: | ||
| types: [submitted] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| # 1) Auto-trigger Codex when PR is opened/reopened/synchronized | ||
| codex-on-pr: | ||
| if: > | ||
| github.event_name == 'pull_request' && | ||
| ( | ||
| github.event.pull_request.user.login == 'EmelyanenkoK' || | ||
| github.event.pull_request.user.login == 'tolya-yanot' || | ||
| github.event.pull_request.user.login == 'SpyCheese' || | ||
| github.event.pull_request.user.login == 'neodix42' || | ||
| github.event.pull_request.user.login == 'dungeon-master-666' || | ||
| github.event.pull_request.user.login == 'igroman787' || | ||
| github.event.pull_request.user.login == 'kdimentionaltree' || | ||
| github.event.pull_request.user.login == 'sonofmom' || | ||
| github.event.pull_request.user.login == 'Trinketer22' || | ||
| github.event.pull_request.user.login == 'xssnick' || | ||
| github.event.pull_request.user.login == 'tolk-vm' || | ||
| github.event.pull_request.user.login == 'DanShaders' || | ||
| github.event.pull_request.user.login == 'birydrad' || | ||
| github.event.pull_request.user.login == 'abacabadabacaba' || | ||
| github.event.pull_request.user.login == 'Mustang98' || | ||
| github.event.pull_request.user.login == 'avevad' || | ||
| github.event.pull_request.user.login == 'tvorogme' || | ||
| github.event.pull_request.user.login == 'krigga' | ||
| ) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Comment to trigger Codex (on PR event) | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body: "@codex review" | ||
| }); | ||
| # 2) Auto-trigger Codex when certain reviewers submit a review | ||
| codex-on-review: | ||
| if: > | ||
| github.event_name == 'pull_request_review' && | ||
| ( | ||
| github.event.review.user.login == 'EmelyanenkoK' || | ||
| github.event.review.user.login == 'tolya-yanot' || | ||
| github.event.review.user.login == 'SpyCheese' || | ||
| github.event.review.user.login == 'neodix42' || | ||
| github.event.review.user.login == 'dungeon-master-666' || | ||
| github.event.review.user.login == 'igroman787' || | ||
| github.event.review.user.login == 'kdimentionaltree' || | ||
| github.event.review.user.login == 'sonofmom' || | ||
| github.event.review.user.login == 'Trinketer22' || | ||
| github.event.review.user.login == 'xssnick' || | ||
| github.event.review.user.login == 'tolk-vm' || | ||
| github.event.review.user.login == 'DanShaders' || | ||
| github.event.review.user.login == 'birydrad' || | ||
| github.event.review.user.login == 'abacabadabacaba' || | ||
| github.event.review.user.login == 'Mustang98' || | ||
| github.event.review.user.login == 'avevad' || | ||
| github.event.review.user.login == 'tvorogme' || | ||
| github.event.review.user.login == 'krigga' | ||
neodix42 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Comment to trigger Codex (on review) | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const reviewer = context.payload.review.user.login; | ||
| const state = context.payload.review.state; // approved | changes_requested | commented | dismissed | ||
| core.info(`Review by ${reviewer} with state: ${state}`); | ||
| // Optional: restrict to certain review states | ||
| if (state !== 'approved' && state !== 'changes_requested') { | ||
| core.info('Skipping Codex trigger – review state not allowed'); | ||
| return; | ||
| } | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body: "@codex review" | ||
| }); | ||
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.