|
1 | 1 | name: Sync OpenAPI schema |
2 | 2 |
|
3 | | -# **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. |
4 | | -# **Why we have it**: So we can consume OpenAPI changes. |
| 3 | +# **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. |
| 4 | +# **Why we have it**: So we can automate updates to REST, Webhooks, and GitHub Apps documentation |
5 | 5 | # **Who does it impact**: Anyone making OpenAPI changes in `github/github`, and wanting to get them published on the docs site. |
6 | 6 |
|
7 | 7 | on: |
@@ -49,19 +49,17 @@ jobs: |
49 | 49 |
|
50 | 50 | - uses: ./.github/actions/node-npm-setup |
51 | 51 |
|
52 | | - - name: Copy dereferenced OpenAPI files |
| 52 | + - name: Get the rest-api-description SHA being synced |
53 | 53 | id: rest-api-description |
54 | 54 | run: | |
55 | | - mkdir ./src/rest/data/dereferenced |
56 | | - find rest-api-description/descriptions-next -type f -name "*.deref.json" -exec sh -c 'cp $1 ./src/rest/data/dereferenced' sh {} \; |
57 | 55 | cd rest-api-description |
58 | 56 | OPENAPI_COMMIT_SHA=$(git rev-parse HEAD) |
59 | 57 | echo "OPENAPI_COMMIT_SHA=$OPENAPI_COMMIT_SHA" >> $GITHUB_OUTPUT |
60 | 58 | echo "Copied files from github/rest-api-description repo. Commit SHA: $OPENAPI_COMMIT_SHA" |
61 | 59 |
|
62 | | - - name: Decorate the dereferenced OpenAPI schemas |
| 60 | + - name: Sync the REST, Webhooks, and GitHub Apps schemas |
63 | 61 | run: | |
64 | | - src/rest/scripts/update-files.js --decorate-only --open-source |
| 62 | + src/rest/scripts/update-files.js --source-repo rest-api-description --output rest github-apps webhooks rest-redirects |
65 | 63 | git status |
66 | 64 | echo "Deleting the cloned github/rest-api-description repo..." |
67 | 65 | rm -rf rest-api-description |
|
0 commit comments