Skip to content

Update OpenAPI specs (BB8AE9CB-0559-4415-B532-FE562067907B) #1

Update OpenAPI specs (BB8AE9CB-0559-4415-B532-FE562067907B)

Update OpenAPI specs (BB8AE9CB-0559-4415-B532-FE562067907B) #1

name: Generate OpenAPI
on:
workflow_dispatch:
inputs:
uuid:
type: string
description: uuid to tag and track Github Actions run
default: ""
run-name: Update OpenAPI specs (${{ inputs.uuid}})
jobs:
generate-openapi-api:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: install Redocly
run: npm i -g @redocly/cli@latest
- name: run Redocly
run: ./modules/ROOT/generate-docs.sh
- name: diff and raise PR
env:
GH_TOKEN: ${{ github.token }}
USER: ${{ github.actor }}
run: |
BRANCH=$(git branch --show-current)
DATE=$(date "+%Y-%m-%d-%H.%M.%S")
git diff
git status
if [[ -n $(git status -s -uno) ]]; then
git checkout -b $BRANCH-$DATE
git config --global user.email "tech-comm-team@couchbase.com"
git config --global user.name "Tech Comm Team Couchbase"
git commit -a -m "Generated Operational API"
git push --set-upstream origin $BRANCH-$DATE
echo $USER
gh pr create --base "$BRANCH" --fill --reviewer "$USER" \
> $GITHUB_STEP_SUMMARY
cat $GITHUB_STEP_SUMMARY
fi