@@ -4,58 +4,66 @@ name: schema-publish
44# issue: https://github.com/OAI/OpenAPI-Specification/issues/3715
55
66#
7- # This workflow creates a pull request for publishing schema iterations to the gh-pages branch
7+ # This workflow creates a pull request for publishing schema iterations to the spec.openapis.org site.
88#
99
1010# run this on push to vX.Y-dev branches or manually
1111on :
1212 push :
1313 branches :
14- - ' v[0-9].[0-9]-dev'
14+ - " v[0-9].[0-9]-dev"
1515 paths :
16- - ' src/schemas/validation/*.yaml'
17- - ' scripts/schema-publish.sh'
18- - ' .github/workflows/schema-publish.yaml'
16+ - " src/schemas/validation/*.yaml"
1917 workflow_dispatch : {}
2018
2119jobs :
2220 publish :
23-
2421 runs-on : ubuntu-latest
2522
2623 steps :
27- - uses : actions/checkout@v5 # checkout main branch
28- with :
29- fetch-depth : 0
30-
31- - uses : actions/setup-node@v5 # setup Node.js
32- with :
33- node-version : ' 22.x'
34-
35- - name : Install dependencies
36- run : npm ci
37-
38- - uses : actions/checkout@v5 # checkout gh-pages branch
39- with :
40- ref : gh-pages
41- path : deploy
42-
43- - name : run main script
44- run : scripts/schema-publish.sh
45-
46- - name : Create Pull Request
47- uses : peter-evans/create-pull-request@v6
48- with :
49- token : ${{ secrets.GITHUB_TOKEN }}
50- branch : ${{ github.ref_name }}-publish-schema-iteration
51- base : gh-pages
52- delete-branch : true
53- path : deploy
54- labels : Housekeeping,Schema
55- reviewers : darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,ralfhandl,handrews,karenetheridge
56- title : ' ${{ github.ref_name }}: publish OpenAPI schema iterations'
57- commit-message : New OpenAPI schema iterations
58- signoff : true
59- body : |
60- This pull request is automatically generated by GitHub action `schema-publish`.
61- The `src/schemas/validation/*.yaml` files have changed and JSON files are automatically generated.
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"
40+
41+ - name : Install dependencies
42+ run : npm ci
43+
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
50+
51+ - name : run main script
52+ run : scripts/schema-publish.sh
53+
54+ - name : Create Pull Request
55+ uses : peter-evans/create-pull-request@v7
56+ with :
57+ token : ${{ steps.generate-token.outputs.token }}
58+ branch : openapi-${{ github.ref_name }}-schema-iterations
59+ base : main
60+ delete-branch : true
61+ path : deploy
62+ labels : OpenAPI,Schema
63+ reviewers : earth2marsh,lornajane,mikekistler,miqui,ralfhandl,whitlockjc,handrews,karenetheridge
64+ title : " OpenAPI - publish ${{ github.ref_name }} schema iterations"
65+ commit-message : " New OpenAPI schema iterations published from ${{ github.ref_name }}"
66+ signoff : true
67+ body : |
68+ This pull request is automatically generated by GitHub action `schema-publish` in the OAI/OpenAPI-Specification repo.
69+ The `src/schemas/validation/*.yaml` files have changed and JSON files are automatically generated.
0 commit comments