Code Generation #861
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |