Skip to content

data-models-update #172

data-models-update

data-models-update #172

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 <openactive-bot@users.noreply.github.com>
author: openactive-bot <openactive-bot@users.noreply.github.com>
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 }}"