Skip to content

Commit d7a0851

Browse files
committed
Skeleton
1 parent 37e4ef0 commit d7a0851

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: schema-publish
2+
3+
# author: @ralfhandl
4+
# issue: https://github.com/OAI/OpenAPI-Specification/issues/3715
5+
6+
#
7+
# This workflow updates the respec 'pretty' rendered versions of the spec
8+
# on the gh-pages branch when the corresponding markdown files change.
9+
#
10+
11+
# run this on push to main
12+
on:
13+
push:
14+
branches:
15+
- main
16+
workflow_dispatch: {}
17+
18+
jobs:
19+
publish:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4 # checkout main branch
25+
with:
26+
fetch-depth: 0
27+
28+
- uses: actions/setup-node@v4 # setup Node.js
29+
with:
30+
node-version: '20.x'
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- uses: actions/checkout@v4 # checkout gh-pages branch
36+
with:
37+
ref: gh-pages
38+
path: deploy
39+
40+
- name: run main script
41+
run: scripts/schema-publish.sh
42+
43+
- name: Create Pull Request
44+
uses: peter-evans/create-pull-request@v6
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
branch: publish-schema-iteration
48+
base: gh-pages
49+
delete-branch: true
50+
path: deploy
51+
labels: Housekeeping,Schema
52+
reviewers: OAI/tsc #TODO: check if this works, or if groups need a different parameter
53+
# team-reviewers: OAI/tsc #TODO: check if this works, or if it needs a special access token
54+
title: Publish OpenAPI Metaschema Iterations
55+
commit-message: New OpenAPI metaschema iterations
56+
signoff: true
57+
body: |
58+
This pull request is automatically triggered by GitHub action `schema-publish`.
59+
60+
The `schemas/**/*.yaml` files have changed and JSON files are automatically generated.
61+
62+

scripts/schema-publish.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Author: @ralfhandl
4+
5+
# run this script from the root of the repo. It is designed to be run by a GitHub workflow.
6+
7+
for filename in schemas/v3*/schema.yaml ; do
8+
version=$(basename $(dirname "$filename"))
9+
mkdir -p deploy/oas/$version
10+
11+
lastCommitDate=$(git log -1 --format="%ad" --date=format:"%Y%m%d" "$filename")
12+
13+
echo $filename $lastCommitDate $version
14+
#TODO:
15+
# - generate JSON file "deploy/oas/$version/schema/$lastCommitDate" from schema.yaml
16+
# - if schema-base.yaml exists, generate JSON file "deploy/oas/$version/schema-base/$lastCommitDate" from schema-base.yaml
17+
done

0 commit comments

Comments
 (0)