Skip to content

Commit 018a8cb

Browse files
committed
Create PRs in new site repo
1 parent 1df0fee commit 018a8cb

File tree

2 files changed

+70
-66
lines changed

2 files changed

+70
-66
lines changed

.github/workflows/respec.yaml

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,72 @@
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:
13+
paths:
14+
- "versions/**"
1415
branches:
1516
- main
1617
workflow_dispatch: {}
1718

1819
jobs:
19-
respec:
20+
publish:
2021
if: github.repository == 'OAI/Overlay-Specification'
21-
22+
2223
runs-on: ubuntu-22.04
2324

2425
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
26+
- name: Generate access token
27+
id: generate-token
28+
uses: actions/create-github-app-token@v1
29+
with:
30+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
31+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
32+
owner: OAI
33+
repositories: spec.openapis.org
34+
35+
- uses: actions/checkout@v5 # checkout main branch of this repo
36+
with:
37+
fetch-depth: 0
38+
39+
- uses: actions/setup-node@v6 # setup Node.js
40+
with:
41+
node-version: "22.x"
3742

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
43+
- name: Install dependencies
44+
run: npm ci
4445

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
46+
- uses: actions/checkout@v5 # checkout main branch of website repo
47+
with:
48+
token: ${{ steps.generate-token.outputs.token }}
49+
repository: OAI/spec.openapis.org
50+
ref: main
51+
path: deploy
5152

52-
- name: run main script
53-
run: scripts/md2html/build.sh
53+
- name: run main script
54+
run: scripts/md2html/build.sh
5455

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

.github/workflows/schema-publish.yaml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,49 @@ 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 changes to schemas to main
1010
on:
1111
push:
12+
paths:
13+
- "schemas/**"
1214
branches:
1315
- main
1416
workflow_dispatch: {}
1517

1618
jobs:
1719
publish:
20+
if: github.repository == 'OAI/Overlay-Specification'
1821
runs-on: ubuntu-latest
1922

2023
steps:
2124
- name: Generate access token
2225
id: generate-token
23-
uses: actions/create-github-app-token@v1
26+
uses: actions/create-github-app-token@v2
2427
with:
2528
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
2629
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
2730
owner: OAI
28-
repositories: OpenAPI-Specification
29-
30-
- uses: actions/checkout@v4 # checkout main branch
31+
repositories: spec.openapis.org
32+
33+
- uses: actions/checkout@v5 # checkout main branch of this repo
3134
with:
3235
fetch-depth: 0
3336

34-
- uses: actions/setup-node@v4 # setup Node.js
37+
- uses: actions/setup-node@v6 # setup Node.js
3538
with:
36-
node-version: 20.x
39+
node-version: "22.x"
3740

3841
- name: Install dependencies
3942
run: npm ci
4043

41-
- uses: actions/checkout@v4 # checkout gh-pages branch
44+
- uses: actions/checkout@v5 # checkout main branch of website repo
4245
with:
4346
token: ${{ steps.generate-token.outputs.token }}
44-
repository: OAI/OpenAPI-Specification
45-
ref: gh-pages
47+
repository: OAI/spec.openapis.org
48+
ref: main
4649
path: deploy
4750

4851
- name: run main script
@@ -52,15 +55,15 @@ jobs:
5255
uses: peter-evans/create-pull-request@v7
5356
with:
5457
token: ${{ steps.generate-token.outputs.token }}
55-
branch: publish-overlay-schema-iteration
56-
base: gh-pages
58+
branch: overlay-schema-iterations
59+
base: main
5760
delete-branch: true
5861
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
62+
labels: Overlay,Schema
63+
reviewers: earth2marsh,lornajane,mikekistler,miqui,baywet,ralfhandl
64+
title: "Overlay - publish schema iterations"
65+
commit-message: "New Overlay schema iterations published from ${{ github.ref_name }}"
6366
signoff: true
6467
body: |
65-
This pull request is automatically triggered by GitHub action `schema-publish` in the OAI/Overlay-Specification repo.
68+
This pull request is automatically generated by GitHub action `schema-publish` in the OAI/Overlay-Specification repo.
6669
The `schemas/**/*.yaml` files have changed and JSON files are automatically generated.

0 commit comments

Comments
 (0)