forked from deanmcgregor/ynab-python
-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (38 loc) · 1.77 KB
/
update_spec.yaml
File metadata and controls
38 lines (38 loc) · 1.77 KB
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
name: Update spec JSON
on:
schedule:
- cron: '0 9 * * *'
jobs:
update_spec:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Update OpenAPI JSON
run: |
curl https://api.youneedabudget.com/papi/spec-v1-swagger.json > spec-v1-swagger.json
# Not using setup-java action b/c we really don't care what java version, just that it's new
# If it ever turns out openapi generator isn't compatible with the newest java, we can
# switch to using the action.
- name: Install required packages
run: |
sudo apt update
sudo apt install -y default-jdk-headless wget
- name: Install and run OpenApi generator
run: |
mkdir -p ~/bin/openapitools
curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli
chmod u+x ~/bin/openapitools/openapi-generator-cli
export PATH=$PATH:~/bin/openapitools/
rm -rf docs test ynab
OPENAPI_GENERATOR_VERSION=4.2.2 openapi-generator-cli generate -g python -i spec-v1-swagger.json -c openapi.yaml
- name: Open Pull Request
uses: peter-evans/[email protected]
env:
COMMIT_MESSAGE: "[Automated] Update openapi-generator-cli and swagger spec"
PULL_REQUEST_TITLE: "[Automated] Update openapi-generator-cli and swagger spec"
PULL_REQUEST_LABELS: "automated"
PULL_REQUEST_REVIEWERS: "davidhao3300"
# TODO: Supply a different github token so that the PR will trigger future github actions.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_SUFFIX: none
PULL_REQUEST_BRANCH: automated/openapi-spec-update