-
Notifications
You must be signed in to change notification settings - Fork 1.1k
46 lines (43 loc) · 1.63 KB
/
make-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
name: Code Generation
on:
schedule:
- cron: "0 0/2 * * *"
jobs:
active-branches:
runs-on: ubuntu-latest
steps:
- id: dump-branches
run: |
curl -s "https://artifacts-api.elastic.co/v1/branches" | jq "[ .branches[] | select(. | startswith(\"6\") | not) ]" --compact-output
curl -s "https://artifacts-api.elastic.co/v1/branches" | jq "[ .branches[] | select(. | startswith(\"6\") | not) ]" --compact-output > branches.json
- id: set-matrix
run: echo "::set-output name=matrix::$(cat branches.json)"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
codegen:
name: Sync
needs: active-branches
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.active-branches.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
with:
ref: "${{ matrix.branch }}"
- run: "./.ci/make.sh codegen ${{ matrix.branch }}"
name: "code-gen ${{ matrix.branch }}"
- name: "PR ${{ matrix.branch }}"
# fixate to known release.
uses: peter-evans/create-pull-request@052fc72b4198ba9fbc81b818c6e1859f747d49a8
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: "fix/${{ matrix.branch }}/code-gen"
base: "${{ matrix.branch }}"
delete-branch: true
commit-message: "[codegen] ${{ matrix.branch }} synchronization"
title: '[codegen] ${{ matrix.branch }} synchronization'
body: |
This synchronizes the client's ${{ matrix.branch }} branch with the server.
labels: "infra,code-gen"