-
Notifications
You must be signed in to change notification settings - Fork 14
52 lines (44 loc) · 1.39 KB
/
codegen.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
name: Codegen
on:
pull_request:
types: [opened, synchronize, closed]
jobs:
notification:
runs-on: ubuntu-22.04
timeout-minutes: 10
if: (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.number
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup
uses: ./.github/actions/setup
with:
type: minimal
- name: Add notification comment
run: yarn workspace scripts upsertGenerationComment notification
env:
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
HEAD_BRANCH: ${{ github.head_ref }}
cleanup:
runs-on: ubuntu-22.04
timeout-minutes: 10
if: github.event.action == 'closed'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Setup
uses: ./.github/actions/setup
with:
type: minimal
- name: Add cleanup comment
run: yarn workspace scripts upsertGenerationComment cleanup
env:
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
- name: Clean previously generated branch
run: yarn workspace scripts cleanGeneratedBranch ${{ github.head_ref }}