|  | 
| 1 | 1 | name: respec | 
| 2 | 2 | 
 | 
| 3 |  | -# author: @MikeRalphson | 
|  | 3 | +# author: @MikeRalphson, @ralfhandl | 
| 4 | 4 | # issue: https://github.com/OAI/OpenAPI-Specification/issues/1564 | 
| 5 | 5 | 
 | 
| 6 | 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. | 
|  | 7 | +# This workflow creates a pull request for publishing HTML spec versions to the spec.openapis.org site. | 
| 9 | 8 | # | 
| 10 | 9 | 
 | 
| 11 |  | -# run this on push to main | 
|  | 10 | +# run this manually or on push to main | 
| 12 | 11 | on: | 
| 13 | 12 |   push: | 
|  | 13 | +    paths: | 
|  | 14 | +      - "versions/**" | 
| 14 | 15 |     branches: | 
| 15 | 16 |       - main | 
| 16 | 17 |   workflow_dispatch: {} | 
| 17 | 18 | 
 | 
| 18 | 19 | jobs: | 
| 19 |  | -  respec: | 
|  | 20 | +  publish: | 
| 20 | 21 |     if: github.repository == 'OAI/Overlay-Specification' | 
| 21 |  | -     | 
|  | 22 | + | 
| 22 | 23 |     runs-on: ubuntu-22.04 | 
| 23 | 24 | 
 | 
| 24 | 25 |     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" | 
| 37 | 42 | 
 | 
| 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 | 
| 44 | 45 | 
 | 
| 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 | 
| 51 | 52 | 
 | 
| 52 |  | -    - name: run main script | 
| 53 |  | -      run: scripts/md2html/build.sh | 
|  | 53 | +      - name: run main script | 
|  | 54 | +        run: scripts/md2html/build.sh | 
| 54 | 55 | 
 | 
| 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. | 
| 70 | 71 | 
 | 
| 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. | 
0 commit comments