respec #306
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: respec | |
# author: @MikeRalphson | |
# issue: https://github.com/OAI/OpenAPI-Specification/issues/1564 | |
# | |
# This workflow updates the respec 'pretty' rendered versions of the spec | |
# on the gh-pages branch when the corresponding markdown files change. | |
# | |
# run this manually from main | |
on: | |
workflow_dispatch: {} | |
jobs: | |
respec: | |
# if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate access token | |
id: generate-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }} | |
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }} | |
owner: OAI | |
repositories: spec.openapis.org | |
- uses: actions/checkout@v4 # checkout main branch | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v5 # setup Node.js | |
with: | |
node-version: "22.x" | |
- name: Install dependencies | |
run: npm ci | |
- uses: actions/checkout@v5 # checkout gh-pages branch | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
repository: OAI/spec.openapis.org | |
ref: main | |
path: deploy | |
- name: run main script | |
run: scripts/md2html/build.sh | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
branch: update-openapi-spec-versions | |
base: main | |
delete-branch: true | |
path: deploy | |
labels: OpenAPI,Specification | |
team-reviewers: tsc | |
title: OpenAPI - Update ReSpec-rendered specification versions | |
commit-message: Update ReSpec-rendered specification versions | |
signoff: true | |
body: | | |
This pull request is automatically generated by GitHub action `respec`. | |
The `versions/*.md` files of the OpenAPI Specification have changed and the corresponding HTML files are regenerated. |