-
Notifications
You must be signed in to change notification settings - Fork 18
64 lines (56 loc) · 2.8 KB
/
update_openapi.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
name: Update OpenAPI specification
on:
repository_dispatch:
types: openapi-spec-change
## Manual request that can be used for testing and retriggering failed updates
workflow_dispatch:
inputs:
url:
description: 'Type of SDK event to handle'
required: true
type: choice
options:
- "https://raw.githubusercontent.com/bf2fc6cc711aee1a0c2a/kas-fleet-manager/main/openapi/kas-fleet-manager.yaml"
- "https://raw.githubusercontent.com/bf2fc6cc711aee1a0c2a/kas-fleet-manager/main/openapi/connector_mgmt.yaml"
- "https://raw.githubusercontent.com/bf2fc6cc711aee1a0c2a/srs-fleet-manager/main/core/src/main/resources/srs-fleet-manager.json"
- "https://raw.githubusercontent.com/5733d9e2be6485d52ffa08870cabdee0/sandbox/main/openapi/smartevents_mgmt_v2.yaml"
- "https://raw.githubusercontent.com/Apicurio/apicurio-registry/main/app/src/main/resources-unfiltered/META-INF/resources/api-specifications/registry/v2/openapi-gen.json"
jobs:
generate_client:
env:
GOPATH: /home/runner/work/app-services-sdk-go/go
CLIENT_ID: ${{ github.event.client_payload.id }}
DOWNLOAD_URL: ${{ github.event.client_payload.download_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.16
- name: Checkout
uses: actions/checkout@v4
- name: Fetch OpenAPI doc
if: github.event.inputs.url != ''
run: ./scripts/fetch_api.sh ${{ github.event.inputs.url }}
- name: Fetch OpenAPI doc
if: github.event.client_payload.download_url != ''
run: ./scripts/fetch_api.sh ${{ github.event.client_payload.download_url }}
- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
with:
title: "chore(openapi): update ${{ env.CLIENT_ID }} OpenAPI document"
token: "${{ secrets.CI_USER_TOKEN }}"
commit-message: >
chore(openapi): update ${{ env.CLIENT_ID }} OpenAPI document
author: "app-services-ci <app-services-ci@users.noreply.github.com>"
branch: chore/add-${{ env.CLIENT_ID }}-openapi
branch-suffix: timestamp
reviewers: '@redhat-developer/app-services-sdk-maintainers'
delete-branch: true
body: >
_This pull request was auto-generated_
This PR adds the latest version OpenAPI document version for **${{ env.CLIENT_ID }}**.
## Actions:
1. Review changes on the OpenAPI file and validate if it is correct.
2. Perform manual changes if needed or apply local patches for the OpenAPI files.
3. Merge this pull request only when the API has been released.
## Changes
${{ steps.generate_openapi_diff.outputs.changelog }}