Skip to content

Commit 8ad64f0

Browse files
committed
chore: added gh action pr review workflow
refs https://jsw.ibm.com/browse/INSTA-83576
1 parent f3bedf5 commit 8ad64f0

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Bob PR review
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
run-bob:
9+
if: |-
10+
(
11+
github.event_name == 'issue_comment' &&
12+
github.event.issue.pull_request &&
13+
github.event.sender.type == 'User' &&
14+
startsWith(github.event.comment.body, '/') &&
15+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
16+
)
17+
runs-on: ibm-x86-64-small
18+
timeout-minutes: 10
19+
permissions:
20+
contents: read
21+
issues: write
22+
pull-requests: write
23+
24+
steps:
25+
- name: Login to private registry
26+
run: |
27+
echo "${{ secrets.REGISTRY_KEY }}" | docker login icr.io/bob-workflows -u iamapikey --password-stdin
28+
29+
- name: Pull Docker image from private registry
30+
run: |
31+
docker pull icr.io/bob-workflows/bob-workflow:latest
32+
33+
- name: Run bob workflow container
34+
env:
35+
API_KEY: ${{ secrets.BOB_API_KEY }}
36+
GITHUB_TOKEN: ${{ github.token }}
37+
GITHUB_API_URL: ${{ github.api_url }}
38+
GITHUB_SERVER_URL: ${{ github.server_url }}
39+
GITHUB_RUN_ID: ${{ github.run_id }}
40+
GITHUB_ACTOR: ${{ github.actor }}
41+
OWNER: ${{ github.repository_owner }}
42+
REPO: ${{ github.event.repository.name }}
43+
PR_NUMBER: ${{ github.event.issue.number }}
44+
COMMENT: ${{ github.event.comment.body }}
45+
BUDGET: 3
46+
run: |
47+
docker run \
48+
-e API_KEY="${API_KEY}" \
49+
-e GITHUB_TOKEN="${GITHUB_TOKEN}" \
50+
-e GITHUB_API_URL="${GITHUB_API_URL}" \
51+
-e GITHUB_SERVER_URL="${GITHUB_SERVER_URL}" \
52+
-e GITHUB_RUN_ID="${GITHUB_RUN_ID}" \
53+
-e GITHUB_ACTOR="${GITHUB_ACTOR}" \
54+
-e OWNER="${OWNER}" \
55+
-e REPO="${REPO}" \
56+
-e PR_NUMBER="${PR_NUMBER}" \
57+
-e COMMENT="${COMMENT}" \
58+
-e BUDGET="${BUDGET}" \
59+
icr.io/bob-workflows/bob-workflow:latest

0 commit comments

Comments
 (0)