-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (28 loc) · 853 Bytes
/
Copy pathspec.yml
File metadata and controls
32 lines (28 loc) · 853 Bytes
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
name: OpenAPI Spec Generator
on:
push:
branches: ["dev"]
jobs:
update_code:
name: Updates the code if the spec changes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Filter for Changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
spec:
- 'spec.yaml'
- name: Run generator
run: docker run --rm -v $PWD:/local openapitools/openapi-generator-cli generate -i /local/spec.yaml -g go-server -o /local/
if: steps.filter.outputs.spec == 'true'
- name: Push code
run: |
git config user.name "GitHub Actions"
git config user.email "i@am.invisible"
git commit -am "Generate OpenAPI"
git push
if: steps.filter.outputs.spec == 'true'