-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (68 loc) · 2.29 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: AdaGPT
on:
# Trigger the workflow on new issues
issues:
types: [opened]
# Trigger the workflow on new pull requests
pull_request:
types: [opened]
# Trigger the workflow on new issue comments
issue_comment:
types: [created]
# Allows the workflow to create comments on issues and pull requests
permissions:
issues: write
pull-requests: write
jobs:
# This job only runs for issues
issue:
name: Issue opened
# Only run the job if the issue contains @AdaGPT
if: ${{ github.event_name == 'issues' && contains(github.event.issue.body, '@AdaGPT') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
name: AdaGPT
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_key: ${{ secrets.OPENAI_KEY }}
# This job only runs for issue comments
issue_comment:
name: Issue comment
# Only run the job if the comment contains @AdaGPT
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@AdaGPT') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
name: AdaGPT
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_key: ${{ secrets.OPENAI_KEY }}
# This job only runs for pull requests
pull_request:
name: PR opened
# Only run the job if the pull request contains @AdaGPT
if: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.body, '@AdaGPT') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
name: AdaGPT
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_key: ${{ secrets.OPENAI_KEY }}
# This job only runs for pull request comments
pull_request_comment:
name: PR comment
# Only run the job if the comment contains @AdaGPT
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@AdaGPT') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
name: AdaGPT
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_key: ${{ secrets.OPENAI_KEY }}