Skip to content

Update OpenAPI specs (8D413CD8-283D-4DFA-8EF2-68DC5DE1789A) #1

Update OpenAPI specs (8D413CD8-283D-4DFA-8EF2-68DC5DE1789A)

Update OpenAPI specs (8D413CD8-283D-4DFA-8EF2-68DC5DE1789A) #1

name: Update 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:
update-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 "Updated 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