Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 36 additions & 11 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Claude Code
on:
issue_comment:
types: [created]
# `edited` matters as much as `created`: mega-putin acks feedback with a
# placeholder the moment it picks the work up and rewrites that same
# comment into the real answer minutes later, so the answer only ever
# arrives as an edit. Jobs that must not re-fire on an edit pin
# `github.event.action == 'created'` themselves.
types: [created, edited]
pull_request_review_comment:
types: [created]
pull_request_review:
Expand All @@ -15,6 +20,7 @@ jobs:
interactive:
if: |
(github.event_name == 'issue_comment' &&
github.event.action == 'created' &&
contains(github.event.comment.body, '@claude') &&
(github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR' ||
Expand Down Expand Up @@ -43,7 +49,7 @@ jobs:
submodules: recursive
fetch-depth: 1

- uses: megaeth-labs/documentation/.github/actions/claude-interactive@main
- uses: megaeth-labs/.github/.github/actions/claude-interactive@main
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
allowed_bots: "mega-putin"
Expand All @@ -54,14 +60,18 @@ jobs:
# rather than cancelling it, so a partial run never leaves comments/threads
# in an inconsistent state.
concurrency:
group: claude-pr-review-${{ github.event.pull_request.number }}
group: claude-pr-review-${{ github.event.pull_request.number || github.event.issue.number }}-${{ github.event_name == 'pull_request' && 'code' || 'comment' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Serialize all review triggers for each pull request

When a PR is synchronized while a qualifying issue comment is created or edited, these expressions place the two pr-review runs in different code and comment concurrency groups, so GitHub can execute them simultaneously. Both invoke the shared reviewer with the CI app identity intended to resolve stale threads, allowing overlapping runs to race on the same review state and defeating the per-PR serialization described immediately above. Use a single group keyed only by the PR number.

Useful? React with 👍 / 👎.

cancel-in-progress: false
if: |
github.event_name == 'pull_request' &&
(github.event.action == 'opened' ||
github.event.action == 'synchronize' ||
github.event.action == 'ready_for_review' ||
github.event.action == 'reopened')
(github.event_name == 'pull_request' &&
(github.event.action == 'opened' ||
github.event.action == 'synchronize' ||
github.event.action == 'ready_for_review' ||
github.event.action == 'reopened')) ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
Comment on lines +71 to +72

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Put the comment-review handler on the default branch

GitHub evaluates issue_comment workflows from the repository’s default branch, not from the PR’s head or its release target. This commit’s parent/default main still has the old pr-review condition that rejects issue_comment, so comments (including the edited mega-putin response this change is intended to process) on the release PR will not start this job until the same workflow change is first present on main. Land the handler on the default branch before relying on it for release-branch PR feedback.

Useful? React with 👍 / 👎.

github.event.comment.user.login != 'mega-maxwell[bot]' &&
!contains(github.event.comment.body, 'claude-review:skip'))
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
Expand All @@ -70,14 +80,29 @@ jobs:
id-token: write
actions: read
steps:
# Review under the CI app identity rather than the job token: it is what
# lets the action resolve stale review threads (the shared action gates
# --resolve-threads on github_identity_token being non-empty).
- uses: actions/create-github-app-token@v3
id: app-token
with:
client-id: ${{ vars.MEGA_MAXWELL_CLIENT_ID }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Configure the app-token action with app-id

actions/create-github-app-token@v3 requires its GitHub App identifier through the app-id input; client-id is not an action input and is ignored. Consequently every pr-review run reaches this step without the required app ID and fails before checkout or the reviewer action can run. Pass the existing client-ID variable as app-id (GitHub accepts a client ID for the JWT issuer) or provide the numeric app ID through that input.

Useful? React with 👍 / 👎.

private-key: ${{ secrets.MEGA_MAXWELL_PK }}
owner: megaeth-labs
repositories: stateless-validator

- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || '' }}
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
submodules: recursive
fetch-depth: 1

- uses: megaeth-labs/documentation/.github/actions/claude-pr-review@main
- uses: megaeth-labs/.github/.github/actions/claude-pr-review@main
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_identity_token: ${{ steps.app-token.outputs.token }}
allowed_bots: "mega-putin"

label-check:
Expand All @@ -103,7 +128,7 @@ jobs:
submodules: recursive
fetch-depth: 1

- uses: megaeth-labs/documentation/.github/actions/claude-label-check@main
- uses: megaeth-labs/.github/.github/actions/claude-label-check@main
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
allowed_bots: "mega-putin"
Expand All @@ -122,7 +147,7 @@ jobs:
submodules: recursive
fetch-depth: 1

- uses: megaeth-labs/documentation/.github/actions/claude-issue-triage@main
- uses: megaeth-labs/.github/.github/actions/claude-issue-triage@main
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
allowed_bots: "mega-putin"
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ alloy-signer-local = "1.0.23"
alloy-trie = { version = "0.9.0", default-features = false }

# mega
mega-evm = { git = "https://github.com/megaeth-labs/mega-evm.git", tag = "v1.7.0", default-features = false }
mega-evm = { git = "https://github.com/megaeth-labs/mega-evm.git", tag = "v1.7.2", default-features = false }
salt = { git = "https://github.com/megaeth-labs/salt.git", tag = "v1.0.5", default-features = false }

# op
Expand Down
Loading