Skip to content
Merged
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
94 changes: 30 additions & 64 deletions .github/workflows/seidroid.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,48 @@
name: seidroid review

on:
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
pull_request:
types: [opened, ready_for_review, synchronize, reopened, closed]

permissions: {}

jobs:
seidroid-review:
seidroid:
# A pull_request run from a fork gets no OIDC token, which the review needs.
if: >-
(github.event_name == 'pull_request' &&
github.event.action != 'closed') ||
(((github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null) ||
github.event_name == 'pull_request_review_comment' ||
github.event_name == 'pull_request_review') &&
contains(github.event.comment.body || github.event.review.body,
'@seidroid review') &&
!contains(github.event.comment.body || github.event.review.body,
'@seidroid review close'))
uses: sei-protocol/uci/.github/workflows/seidroid-review.yml@a3e422db031508ff0b2adf2e66e5a2860a8858e2 # v0.0.27
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
uses: sei-protocol/seidroid/.github/workflows/review.yml@c9706feea6d1ff72e9457a66786b2adfac2fd068 # v0.3.3
permissions:
contents: read
pull-requests: write
checks: write
issues: write
secrets:
OMNIGENT_MACHINE_CLIENT_SECRET: ${{ secrets.OMNIGENT_MACHINE_CLIENT_SECRET }}
SEIDROID_APP_ID: ${{ secrets.PLATFORM_CODE_AGENT_APP_ID }}
SEIDROID_APP_PRIVATE_KEY: ${{ secrets.PLATFORM_CODE_AGENT_APP_PK }}
pull-requests: read
id-token: write
with:
mode: review
allowed-team: 'sei-protocol/sei-core'
allowed-bots: '["seidroid[bot]"]'
shadow: false
approve-on-success: true

# Anchored, unlike the review job's `contains`. A comment that quotes the
# teardown command beside a real `@seidroid review` line would otherwise route
# here, and uci v0.0.25 admits it on the review line without checking it
# against `mode`, so the session would be destroyed. Anchoring only this,
# destructive, job keeps such a comment from destroying anything. PLT-1182
# fixes the grammar once in uci, which can compare the parsed line to `mode`.
seidroid-review-close:
if: >-
github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
startsWith(github.event.comment.body, '@seidroid review close')
uses: sei-protocol/uci/.github/workflows/seidroid-review.yml@a3e422db031508ff0b2adf2e66e5a2860a8858e2 # v0.0.27
permissions:
contents: read
pull-requests: write
checks: write
issues: write
secrets:
OMNIGENT_MACHINE_CLIENT_SECRET: ${{ secrets.OMNIGENT_MACHINE_CLIENT_SECRET }}
SEIDROID_APP_ID: ${{ secrets.PLATFORM_CODE_AGENT_APP_ID }}
SEIDROID_APP_PRIVATE_KEY: ${{ secrets.PLATFORM_CODE_AGENT_APP_PK }}
with:
mode: close
allowed-team: 'sei-protocol/sei-core'

seidroid-review-reclaim:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
uses: sei-protocol/uci/.github/workflows/seidroid-review.yml@a3e422db031508ff0b2adf2e66e5a2860a8858e2 # v0.0.27
permissions:
contents: read
pull-requests: write
checks: write
issues: write
secrets:
OMNIGENT_MACHINE_CLIENT_SECRET: ${{ secrets.OMNIGENT_MACHINE_CLIENT_SECRET }}
SEIDROID_APP_ID: ${{ secrets.PLATFORM_CODE_AGENT_APP_ID }}
SEIDROID_APP_PRIVATE_KEY: ${{ secrets.PLATFORM_CODE_AGENT_APP_PK }}
with:
mode: close
allowed-bots: seidroid[bot]
# Unset reads REVIEW.md, which this repository does not keep.
guidelines-file: AGENTS.md
# The review's sandbox has no network, and the runner's Go may be older
# than go.mod's, so install that version into the sandbox's home and
# fetch the modules first.
prepare: >-
v=$(awk '$1 == "go" {print $2 ~ /^[0-9]+\.[0-9]+$/ ? $2 ".0" : $2; exit}' go.mod) &&
mkdir -p ~/sdk &&
curl --proto '=https' --tlsv1.2 -fsSL "https://go.dev/dl/go$v.linux-$(dpkg --print-architecture).tar.gz" |
tar -xzC ~/sdk &&
~/sdk/go/bin/go mod download
extra-instructions: >-
Go is in ~/sdk/go/bin, which is not on PATH, and the modules are
already downloaded, as there is no network; run
`export PATH="$HOME/sdk/go/bin:$PATH" GOPROXY=off` before using go.
Build with `go build ./...`, test with `go test -race -count=1 ./...`,
and check `go vet ./...`, `go vet -tags e2e ./e2e` and `gofmt -l .`.
The e2e tests need a live node and golangci-lint needs the network,
so leave both to CI.
Loading