-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (66 loc) · 2.61 KB
/
create-data-model-pr.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Update Data Model
on:
workflow_dispatch:
repository_dispatch:
types: [data-models-update]
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout models-ruby
uses: actions/checkout@v2
with:
ref: master
path: models-ruby
- name: Checkout models-lib
uses: actions/checkout@v2
with:
repository: openactive/models-lib
path: models-lib
- name: Setup Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install models-lib
run: npm install
working-directory: ./models-lib/
- name: Update models-lib with latest data-models
run: npm update @openactive/data-models
working-directory: ./models-lib/
- name: Remove existing model files
run: rm -rf lib/openactive/models lib/openactive/enums
working-directory: ./models-lib/
- name: Run Ruby models generator
run: npm start -- generate Ruby --destination ../models-ruby/lib/openactive/
working-directory: ./models-lib/
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
working-directory: ./models-ruby/
- name: Fix syntax / linting
run: bundle exec rubocop -a lib/openactive/models lib/openactive/enums
working-directory: ./models-ruby/
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
path: ./models-ruby/
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
commit-message: Update data models
committer: openactive-bot <[email protected]>
author: openactive-bot <[email protected]>
signoff: false
branch: ci/update-data-models
delete-branch: true
title: 'Update data models'
body: |
Update Ruby data models to the latest version based on the [OpenActive Vocabulary](https://openactive.io/ns/) (codified by the [Data Models](https://github.com/openactive/data-models)), [Test Interface](https://openactive.io/test-interface/) and [Beta Namespace](https://openactive.io/ns-beta/).
labels: |
automated pr
draft: false
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"