Skip to content

Commit 29df6f0

Browse files
authored
Merge pull request #175 from ralfhandl/main-respec-file-filter
main: Run respec workflow only if spec versions change
2 parents 93669ce + 37f9113 commit 29df6f0

File tree

1 file changed

+47
-45
lines changed

1 file changed

+47
-45
lines changed

.github/workflows/respec.yaml

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,68 +4,70 @@ name: respec
44
# issue: https://github.com/OAI/OpenAPI-Specification/issues/1564
55

66
#
7-
# This workflow updates the respec 'pretty' rendered versions of the spec
7+
# This workflow updates the respec 'pretty' rendered versions of the spec
88
# on the gh-pages branch when the corresponding markdown files change.
99
#
1010

11-
# run this on push to main
11+
# run this on push of new spec versions to main
1212
on:
1313
push:
14+
paths:
15+
- "versions/**"
1416
branches:
1517
- main
1618
workflow_dispatch: {}
1719

1820
jobs:
1921
respec:
2022
if: github.repository == 'OAI/Overlay-Specification'
21-
23+
2224
runs-on: ubuntu-22.04
2325

2426
steps:
25-
- name: Generate access token
26-
id: generate-token
27-
uses: actions/create-github-app-token@v2
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@v5 # checkout main branch
35-
with:
36-
fetch-depth: 0
27+
- name: Generate access token
28+
id: generate-token
29+
uses: actions/create-github-app-token@v1
30+
with:
31+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
32+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
33+
owner: OAI
34+
repositories: OpenAPI-Specification
35+
36+
- uses: actions/checkout@v5 # checkout main branch
37+
with:
38+
fetch-depth: 0
39+
40+
- uses: actions/setup-node@v6 # setup Node.js
41+
with:
42+
node-version: "20.x"
3743

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

45-
- uses: actions/checkout@v5 # 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
47+
- uses: actions/checkout@v5 # checkout gh-pages branch
48+
with:
49+
token: ${{ steps.generate-token.outputs.token }}
50+
repository: OAI/OpenAPI-Specification # TODO: change to OAI/...
51+
ref: gh-pages
52+
path: deploy
5153

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

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

0 commit comments

Comments
 (0)