We use rapidoc as a Discourse theme component to render OpenAPI specifications in forum posts. This repository provides a GitHub Action to upload the specification file and update a given topic with the newly uploaded file.
discourse_url
- your discourse instance domain, e.g. "community.developer.gridx.dediscourse_post_id
- the ID of the Discourse post to update, you can find it, e.g., by inspecting your post in the browser and looking fordata-post-id="<n>"
in thearticle
element. (XPath//article/@data-post-id
)discourse_api_key
- your discourse API key. It needsposts - edit
anduploads - create
permissions.discourse_user
- the discourse user on whose behalf the action should be executed.github_sha
- the commit hash to put into the post as reference, can be obtained using$GITHUB_SHA
when running in an action or withgit rev-parse --short HEAD
spec_file
- the specification file to be uploaded, relative to the repositories root
- Create a topic that hosts your specification on your Discourse instance using https://github.com/wwerner/discourse-rapidoc-theme-component
- Get the required parameters as described above
- Configure the action in your GH workflow, preferably on release
- Profit
- You can run the action locally using
npm run test:run
, providing the configuration parameters through the environment. See test.ts. - See package.json for linting, testing and formatting scripts.