|
80 | 80 | pull_request:
|
81 | 81 | types:
|
82 | 82 | - opened
|
| 83 | + - synchronize |
83 | 84 |
|
84 | 85 | jobs:
|
85 |
| - update_pr: |
| 86 | + update_pull_request: |
86 | 87 | runs-on: ubuntu-latest
|
87 |
| - steps: |
88 |
| - - name: Check out the repository |
89 |
| - uses: actions/checkout@v2 |
90 | 88 |
|
| 89 | + steps: |
91 | 90 | - name: Set up Go
|
92 | 91 | uses: actions/setup-go@v2
|
93 | 92 | with:
|
94 | 93 | go-version: 1.19
|
95 | 94 |
|
96 |
| - - name: Build the commands |
| 95 | + - name: Checkout GPT-PullRequest-Updater |
| 96 | + uses: actions/checkout@v2 |
| 97 | + with: |
| 98 | + repository: ravilushqa/gpt-pullrequest-updater |
| 99 | + path: gpt-pullrequest-updater |
| 100 | + |
| 101 | + - name: Build description and review commands |
97 | 102 | run: |
|
| 103 | + cd gpt-pullrequest-updater |
98 | 104 | go build -o description ./cmd/description
|
99 | 105 | go build -o review ./cmd/review
|
100 | 106 |
|
101 |
| - - name: Run the GPT Updater |
| 107 | + - name: Update Pull Request Description |
102 | 108 | run: |
|
103 |
| - export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} |
104 |
| - export OPENAI_TOKEN=${{ secrets.OPENAI_TOKEN }} |
105 |
| - export OWNER=${{ github.repository_owner }} |
106 |
| - export REPO=${{ github.event.repository.name }} |
107 |
| - export PR_NUMBER=${{ github.event.number }} |
108 |
| - ./description |
109 |
| - ./review |
| 109 | + ./gpt-pullrequest-updater/description |
| 110 | + env: |
| 111 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 112 | + OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} |
| 113 | + OWNER: ${{ github.repository_owner }} |
| 114 | + REPO: ${{ github.event.repository.name }} |
| 115 | + PR_NUMBER: ${{ github.event.number }} |
| 116 | + |
| 117 | + - name: Review Pull Request |
| 118 | + if: github.event.action == 'opened' |
| 119 | + run: | |
| 120 | + ./gpt-pullrequest-updater/review |
| 121 | + env: |
| 122 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 123 | + OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} |
| 124 | + OWNER: ${{ github.repository_owner }} |
| 125 | + REPO: ${{ github.event.repository.name }} |
| 126 | + PR_NUMBER: ${{ github.event.number }} |
| 127 | + |
110 | 128 | ```
|
111 | 129 |
|
112 | 130 | Make sure to add your OpenAI API token to your repository secrets as `OPENAI_TOKEN`.
|
|
0 commit comments