hosted/.forgejo/workflows/build.yml

52 lines
1.2 KiB
YAML
Raw Normal View History

2024-10-26 22:35:26 +02:00
name: Update API Documentation
on:
2024-10-26 22:36:23 +02:00
workflow_dispatch:
2024-10-26 22:35:26 +02:00
push:
paths:
2024-10-26 22:36:23 +02:00
- 'openapi.yaml'
2024-10-26 22:35:26 +02:00
branches:
2024-10-26 22:36:23 +02:00
- main
2024-10-26 22:35:26 +02:00
jobs:
convert-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout wiki
uses: actions/checkout@v3
with:
repository: ${{github.repository}}.wiki
path: wiki
2024-10-26 22:41:49 +02:00
ref: main
2024-10-26 22:35:26 +02:00
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Widdershins
run: npm install -g widdershins
- name: Convert OpenAPI to Markdown
run: |
2024-10-26 22:49:39 +02:00
widdershins openapi.yaml -o wiki/api.md --omitHeader --summary --expandBody -c
2024-10-26 22:35:26 +02:00
- name: Configure Git
run: |
cd wiki
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Commit and push changes to wiki
run: |
cd wiki
git add api.md
git diff-index --quiet HEAD || git commit -m "Update API documentation"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}