-
Notifications
You must be signed in to change notification settings - Fork 38
53 lines (41 loc) · 1.32 KB
/
generate-open-api.yml
File metadata and controls
53 lines (41 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
shell: bash
run: ./modules/ROOT/generate-docs.sh
- name: diff and raise PR
env:
GH_TOKEN: ${{ github.token }}
USER: ${{ github.actor }}
shell: bash
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