Generate API changelogs #106
This file contains 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: Generate API changelogs | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 20 * * *' | |
jobs: | |
generate-changelog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Generate code | |
run: npm run generate | |
- name: Install oasdiff | |
run: | | |
wget https://github.com/Tufin/oasdiff/releases/download/v1.10.23/oasdiff_1.10.23_linux_amd64.tar.gz | |
tar xzf oasdiff_1.10.23_linux_amd64.tar.gz | |
mv oasdiff /usr/local/bin/oasdiff | |
- name: Git Identity 🪪 | |
run: | | |
git config user.name "mittwald-machine" | |
git config user.email "[email protected]" | |
- name: Generate API changelogs | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
run: | | |
npm run generate:changelog | |
if [ $(git status --porcelain changelog static/specs | wc -l) -gt 0 ] ; then | |
git add changelog static/specs | |
git commit -m "Generate API changelog for $(date +%d-%m-%Y)"; | |
fi | |
- name: Synchronize CLI docs | |
run: | | |
npm run generate:cli | |
if [ $(git status --porcelain docs/cli | wc -l) -gt 0 ] ; then | |
git add docs/cli | |
git commit -m "Synchronize CLI documentation from mittwald/cli"; | |
fi | |
- name: Push changes | |
run: | | |
git remote add publish "https://mittwald-machine:${{ secrets.RELEASE_USER_TOKEN }}@github.com/mittwald/developer-portal.git" | |
git push publish |