-
Notifications
You must be signed in to change notification settings - Fork 22
64 lines (58 loc) · 2.63 KB
/
generate_jsonschema.yaml
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
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Generate JSON Schema
on:
push:
branches:
- "main"
jobs:
generate-schema:
runs-on: ubuntu-22.04
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Generate the JSON Schema
uses: ./.github/workflows/generate_jsonschema
- name: Create pull request for schema updates
uses: googleapis/code-suggester@v4
env:
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }} # Provided by GitHub Automation team
with:
command: pr
upstream_owner: ${{ github.repository_owner }}
upstream_repo: "google-cloudevents"
description: |
:robot: Auto-generated Pull Request.
Triggered by [${{ github.event.repository.full_name }}@${{ github.event.head_commit.id }}](https://github.com/${{ github.event.repository.full_name }}/commit/${{ github.event.head_commit.id }})
* **Generator configuration:** https://github.com/${{ github.repository }}/blob/${{ github.sha }}/.github/workflows/generate_jsonschema.yaml
* **Generator script:** https://github.com/${{ github.repository }}/blob/${{ github.sha }}/scripts/gen.sh
* **List of workflow runs:** https://github.com/${{ github.repository }}/actions/workflows/generate_jsonschema.yaml
title: "chore: Generate the JSON Schema" # PR title
message: "chore: Generate the JSON Schema" # commit message
branch: "main" # branch for forked repo
git_dir: "."
primary: "main"
force: true # force push a reference
fork: true # action automatically forks repo
- name: Notify for failure
if: ${{ failure() }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'JSON Schema generation failed!',
body: `See [failed job](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
});