refactor openapi scripts (#34803)
This commit is contained in:
12
.github/workflows/openapi-decorate.yml
vendored
12
.github/workflows/openapi-decorate.yml
vendored
@@ -1,7 +1,7 @@
|
||||
name: Sync OpenAPI schema
|
||||
|
||||
# **What it does**: Once a day, this workflow syncs the dereferenced files from github/rest-api-description and creates a pull request if there are updates to any of the static files we generate from the OpenAPI.
|
||||
# **Why we have it**: So we can consume OpenAPI changes.
|
||||
# **What it does**: Once a day, this workflow syncs the REST, Webhooks, and GitHub Apps automated pipelines with the github/rest-api-description repository, and creates a pull request if there are updates to any of the data files we generate from the OpenAPI.
|
||||
# **Why we have it**: So we can automate updates to REST, Webhooks, and GitHub Apps documentation
|
||||
# **Who does it impact**: Anyone making OpenAPI changes in `github/github`, and wanting to get them published on the docs site.
|
||||
|
||||
on:
|
||||
@@ -49,19 +49,17 @@ jobs:
|
||||
|
||||
- uses: ./.github/actions/node-npm-setup
|
||||
|
||||
- name: Copy dereferenced OpenAPI files
|
||||
- name: Get the rest-api-description SHA being synced
|
||||
id: rest-api-description
|
||||
run: |
|
||||
mkdir ./src/rest/data/dereferenced
|
||||
find rest-api-description/descriptions-next -type f -name "*.deref.json" -exec sh -c 'cp $1 ./src/rest/data/dereferenced' sh {} \;
|
||||
cd rest-api-description
|
||||
OPENAPI_COMMIT_SHA=$(git rev-parse HEAD)
|
||||
echo "OPENAPI_COMMIT_SHA=$OPENAPI_COMMIT_SHA" >> $GITHUB_OUTPUT
|
||||
echo "Copied files from github/rest-api-description repo. Commit SHA: $OPENAPI_COMMIT_SHA"
|
||||
|
||||
- name: Decorate the dereferenced OpenAPI schemas
|
||||
- name: Sync the REST, Webhooks, and GitHub Apps schemas
|
||||
run: |
|
||||
src/rest/scripts/update-files.js --decorate-only --open-source
|
||||
src/rest/scripts/update-files.js --source-repo rest-api-description --output rest github-apps webhooks rest-redirects
|
||||
git status
|
||||
echo "Deleting the cloned github/rest-api-description repo..."
|
||||
rm -rf rest-api-description
|
||||
|
||||
Reference in New Issue
Block a user