remove openapi dereferenced static files (#33297)
This commit is contained in:
13
.github/workflows/openapi-decorate.yml
vendored
13
.github/workflows/openapi-decorate.yml
vendored
@@ -65,3 +65,16 @@ jobs:
|
||||
env:
|
||||
# Disable pre-commit hooks; they don't play nicely with add-and-commit
|
||||
HUSKY: '0'
|
||||
|
||||
- name: Remove the dereferenced files
|
||||
uses: EndBug/add-and-commit@050a66787244b10a4874a2a5f682130263edc192
|
||||
with:
|
||||
# The arguments for the `git add` command
|
||||
remove: '["lib/rest/static/dereferenced/*"]'
|
||||
|
||||
# The message for the commit
|
||||
message: 'Removed dereferenced OpenAPI schema files'
|
||||
|
||||
env:
|
||||
# Disable pre-commit hooks; they don't play nicely with add-and-commit
|
||||
HUSKY: '0'
|
||||
|
||||
59
.github/workflows/openapi-schema-check.yml
vendored
59
.github/workflows/openapi-schema-check.yml
vendored
@@ -1,59 +0,0 @@
|
||||
name: OpenAPI dev mode check
|
||||
|
||||
# **What it does**: Checks that the files in lib/rest/static/decorated match
|
||||
# the files in lib/rest/static/dereferenced. Checks that the decorated
|
||||
# schemas in lib/rest/static/decorated are not in development mode.
|
||||
# Development mode schemas have a branch name and development mode tag in the
|
||||
# info.version property.
|
||||
# **Why we have it**: To ensure that we aren't every shipping decorated schemas
|
||||
# that are out of sync with the source derefereced schema. To ensure that
|
||||
# decorated schemas generated locally are not published. Locally generated
|
||||
# decorated schemas are pushing up to the remote for staging purposes only.
|
||||
# **Who does it impact**: Docs content writers updating REST API docs and
|
||||
# the docs engineering team as maintainers of the scripts and workflows.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
paths:
|
||||
- 'lib/rest/static/**'
|
||||
- 'script/rest/**/*.js'
|
||||
- 'script/rest/**/*.json'
|
||||
- 'package*.json'
|
||||
- 'lib/redirects/static/**/*.json'
|
||||
- '.github/workflows/openapi-schema-check.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# This allows a subsequently queued workflow run to interrupt previous runs
|
||||
concurrency:
|
||||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check-schema-versions:
|
||||
if: ${{ github.repository == 'github/docs-internal' }}
|
||||
runs-on: ubuntu-20.04-xl
|
||||
steps:
|
||||
- name: Checkout repository code
|
||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
|
||||
with:
|
||||
node-version: '16.17.0'
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
# Differences between decorated and dereferenced files indicates a problem
|
||||
- name: Generate decorated files to check that there are no differences
|
||||
run: script/rest/update-files.js --decorate-only
|
||||
|
||||
- name: Check if deref/decorated schemas are dev mode and that they match
|
||||
run: .github/actions-scripts/openapi-schema-branch.js
|
||||
Reference in New Issue
Block a user