Skip to content

Commit 36a2b59

Browse files
committed
Create PRs in new site repo
1 parent 1df0fee commit 36a2b59

File tree

2 files changed

+66
-65
lines changed

2 files changed

+66
-65
lines changed

.github/workflows/respec.yaml

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,70 @@
11
name: respec
22

3-
# author: @MikeRalphson
3+
# author: @MikeRalphson, @ralfhandl
44
# issue: https://github.com/OAI/OpenAPI-Specification/issues/1564
55

66
#
7-
# This workflow updates the respec 'pretty' rendered versions of the spec
8-
# on the gh-pages branch when the corresponding markdown files change.
7+
# This workflow creates a pull request for publishing HTML spec versions to the spec.openapis.org site.
98
#
109

11-
# run this on push to main
10+
# run this manually or on push to main
1211
on:
1312
push:
1413
branches:
1514
- main
1615
workflow_dispatch: {}
1716

1817
jobs:
19-
respec:
18+
publish:
2019
if: github.repository == 'OAI/Overlay-Specification'
21-
20+
2221
runs-on: ubuntu-22.04
2322

2423
steps:
25-
- name: Generate access token
26-
id: generate-token
27-
uses: actions/create-github-app-token@v1
28-
with:
29-
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
30-
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
31-
owner: OAI
32-
repositories: OpenAPI-Specification
33-
34-
- uses: actions/checkout@v4 # checkout main branch
35-
with:
36-
fetch-depth: 0
24+
- name: Generate access token
25+
id: generate-token
26+
uses: actions/create-github-app-token@v1
27+
with:
28+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
29+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
30+
owner: OAI
31+
repositories: spec.openapis.org
32+
33+
- uses: actions/checkout@v5 # checkout main branch of this repo
34+
with:
35+
fetch-depth: 0
36+
37+
- uses: actions/setup-node@v5 # setup Node.js
38+
with:
39+
node-version: "22.x"
3740

38-
- uses: actions/setup-node@v4 # setup Node.js
39-
with:
40-
node-version: '20.x'
41-
42-
- name: Install dependencies
43-
run: npm ci
41+
- name: Install dependencies
42+
run: npm ci
4443

45-
- uses: actions/checkout@v4 # checkout gh-pages branch
46-
with:
47-
token: ${{ steps.generate-token.outputs.token }}
48-
repository: OAI/OpenAPI-Specification # TODO: change to OAI/...
49-
ref: gh-pages
50-
path: deploy
44+
- uses: actions/checkout@v5 # checkout main branch of website repo
45+
with:
46+
token: ${{ steps.generate-token.outputs.token }}
47+
repository: OAI/spec.openapis.org
48+
ref: main
49+
path: deploy
5150

52-
- name: run main script
53-
run: scripts/md2html/build.sh
51+
- name: run main script
52+
run: scripts/md2html/build.sh
5453

55-
- name: Create Pull Request
56-
uses: peter-evans/create-pull-request@v7
57-
with:
58-
token: ${{ steps.generate-token.outputs.token }}
59-
branch: update-overlay-respec-version
60-
base: gh-pages
61-
delete-branch: true
62-
path: deploy
63-
labels: Housekeeping
64-
reviewers: darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,handrews,ralfhandl
65-
title: Overlay - Update ReSpec-rendered specification versions
66-
commit-message: Update ReSpec-rendered specification versions
67-
signoff: true
68-
body: |
69-
This pull request is automatically triggered by GitHub action `respec` in the OAI/Overlay-Specification repo.
54+
- name: Create Pull Request
55+
uses: peter-evans/create-pull-request@v7
56+
with:
57+
token: ${{ steps.generate-token.outputs.token }}
58+
branch: overlay-spec-versions
59+
base: main
60+
delete-branch: true
61+
path: deploy
62+
labels: Overlay,Specification
63+
reviewers: earth2marsh,lornajane,mikekistler,miqui,handrews,ralfhandl
64+
title: Overlay - update ReSpec-rendered specification versions
65+
commit-message: Update ReSpec-rendered specification versions
66+
signoff: true
67+
body: |
68+
This pull request is automatically generated by GitHub action `respec` in the OAI/Overlay-Specification repo.
7069
71-
The `versions/*.md` files have changed, so the HTML files are automatically being regenerated.
70+
The `versions/*.md` files of the OpenAPI Specification have changed and the corresponding HTML files are regenerated.

.github/workflows/schema-publish.yaml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ name: schema-publish
33
# author: @ralfhandl
44

55
#
6-
# This workflow copies the x.y schemas to the gh-pages branch
6+
# This workflow creates a pull request for publishing schema iterations to the spec.openapis.org site.
77
#
88

9-
# run this on push to main
9+
# run this on push of new spec versions to main
1010
on:
1111
push:
12+
paths:
13+
- "versions/**"
1214
branches:
1315
- main
1416
workflow_dispatch: {}
@@ -25,24 +27,24 @@ jobs:
2527
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
2628
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
2729
owner: OAI
28-
repositories: OpenAPI-Specification
29-
30-
- uses: actions/checkout@v4 # checkout main branch
30+
repositories: spec.openapis.org
31+
32+
- uses: actions/checkout@v5 # checkout main branch of this repo
3133
with:
3234
fetch-depth: 0
3335

34-
- uses: actions/setup-node@v4 # setup Node.js
36+
- uses: actions/setup-node@v5 # setup Node.js
3537
with:
36-
node-version: 20.x
38+
node-version: "22.x"
3739

3840
- name: Install dependencies
3941
run: npm ci
4042

41-
- uses: actions/checkout@v4 # checkout gh-pages branch
43+
- uses: actions/checkout@v5 # checkout main branch of website repo
4244
with:
4345
token: ${{ steps.generate-token.outputs.token }}
44-
repository: OAI/OpenAPI-Specification
45-
ref: gh-pages
46+
repository: OAI/spec.openapis.org
47+
ref: main
4648
path: deploy
4749

4850
- name: run main script
@@ -52,15 +54,15 @@ jobs:
5254
uses: peter-evans/create-pull-request@v7
5355
with:
5456
token: ${{ steps.generate-token.outputs.token }}
55-
branch: publish-overlay-schema-iteration
56-
base: gh-pages
57+
branch: overlay-${{ github.ref_name }}-schema-iterations
58+
base: main
5759
delete-branch: true
5860
path: deploy
59-
labels: Housekeeping,Schema
60-
reviewers: darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,handrews,ralfhandl
61-
title: Overlay - Publish Schema Iterations
62-
commit-message: New Overlay schema iterations
61+
labels: Overlay,Schema
62+
reviewers: earth2marsh,lornajane,mikekistler,miqui,handrews,ralfhandl
63+
title: "Overlay - publish schema iterations"
64+
commit-message: "New Overlay schema iterations published from ${{ github.ref_name }}"
6365
signoff: true
6466
body: |
65-
This pull request is automatically triggered by GitHub action `schema-publish` in the OAI/Overlay-Specification repo.
67+
This pull request is automatically generated by GitHub action `schema-publish` in the OAI/Overlay-Specification repo.
6668
The `schemas/**/*.yaml` files have changed and JSON files are automatically generated.

0 commit comments

Comments
 (0)