http method github GET /api/v3/repos/cloudflare/pint/pulls/123/reviews 200 []
http method github POST /api/v3/repos/cloudflare/pint/pulls/123/reviews 200 {}
http method github GET /api/v3/repos/cloudflare/pint/pulls/123/comments 200 []
http method github POST /api/v3/repos/cloudflare/pint/pulls/123/comments 200 {}
http start github 127.0.0.1:6084

mkdir testrepo
cd testrepo
exec git init --initial-branch=main .

cp ../src/v1.yml rules.yml
cp ../src/.pint.hcl .
env GIT_AUTHOR_NAME=pint
env GIT_AUTHOR_EMAIL=pint@example.com
env GIT_COMMITTER_NAME=pint
env GIT_COMMITTER_EMAIL=pint@example.com
exec git add .
exec git commit -am 'import rules and config'

exec git checkout -b v2
cp ../src/v2.yml rules.yml
exec git commit -am 'v2'

env GITHUB_AUTH_TOKEN=12345
env GITHUB_ACTION=YES
env GITHUB_EVENT_NAME=pull_request
env GITHUB_REF=refs/pull/123/merge
env GITHUB_BASE_REF=main
env GITHUB_REPOSITORY=foo/bar
env GITHUB_API_URL=http://127.0.0.1:6084
pint.ok -l debug --offline --no-color ci
! stdout .
stderr 'level=info msg="Pull request review created" status="200 OK"'
stderr 'level=info msg="Setting GITHUB_PULL_REQUEST_NUMBER from GITHUB_REF env variable" pr=123'
stderr 'level=info msg="Setting repository base URI from GITHUB_API_URL env variable" baseuri=http://127.0.0.1:6084'

-- src/v1.yml --
groups:
- name: foo
  rules:
  - alert: rule1
    expr: sum(foo) by(job)
  - alert: rule2
    expr: sum(foo) by(job)
    for: 0s

-- src/v2.yml --
groups:
- name: foo
  rules:
  - alert: rule1
    expr: sum(foo) by(job)
    for: 0s
  - alert: rule2
    expr: sum(foo) by(job)
    for: 0s

-- src/.pint.hcl --
repository {
  github {
	uploaduri = "http://127.0.0.1:6084"
    owner     = "cloudflare"
    repo      = "pint"
  }
}
