-
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (71 loc) · 2.56 KB
/
openapi.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: "OpenAPI"
on:
schedule:
# Update Monday
- cron: "31 04 * * 1"
workflow_dispatch: null
permissions:
contents: "write"
pull-requests: "write"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
generate:
name: "Generate PHP client"
strategy:
matrix:
openapi-version:
- "6.6.0"
billingo-spec:
- "3.0.15"
runs-on: "ubuntu-22.04"
timeout-minutes: 5
steps:
-
name: "Checkout repository"
uses: "actions/checkout@v4"
-
name: "Set up Java"
uses: "actions/setup-java@v4"
with:
distribution: "temurin"
java-version: "17"
-
name: "Install OpenAPI"
run: |
wget -O "${{ runner.temp }}/openapi-generator-cli.jar" \
"https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${{ matrix.openapi-version }}/openapi-generator-cli-${{ matrix.openapi-version }}.jar"
-
name: "Download spec"
run: |
wget -O "${{ runner.temp }}/spec.json" \
"https://app.swaggerhub.com/apiproxy/registry/Billingo/Billingo/${{ matrix.billingo-spec }}"
-
name: "Generate client"
run: |
java -jar "${{ runner.temp }}/openapi-generator-cli.jar" generate \
--input-spec "${{ runner.temp }}/spec.json" \
--generator-name php \
--output ./ \
--additional-properties 'invokerPackage=Cone\Billingo,variableNamingConvention=camelCase'
-
name: "Check difference to repository"
id: "list_diff"
run: |
if ! git diff --exit-code; then
echo "exit_status=1" >>"${GITHUB_OUTPUT}"
fi
-
name: "Create pull request"
if: "${{ steps.list_diff.outputs.exit_status == '1' }}"
uses: "peter-evans/create-pull-request@v4"
with:
add-paths: "./"
branch: "php-client"
commit-message: "Upgrade client"
title: "Upgrade PHP client to ${{ matrix.billingo-spec }}"
body: |
Automated changes by running `openapi-generator-cli.jar generate`.
delete-branch: true