Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: ${{ github.workspace }}/packages/matrix-invite/**/*
files: packages/matrix-invite/**/*
- name: Build and publish matrix-invite docker image
if: steps.changed-files.outputs.test_any_changed == 'true'
uses: philips-software/docker-ci-scripts@v5.1.0
Expand All @@ -71,6 +71,8 @@ jobs:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Node LTS
uses: actions/setup-node@v3
with:
Expand All @@ -80,23 +82,24 @@ jobs:
- name: Generate Swagger documentation
run: npm run doc
- name: Check if documentation files has changed
id: changed-files
uses: tj-actions/changed-files@v41
id: verify-changed-files
uses: tj-actions/verify-changed-files@v17
with:
files: ${{ github.workspace }}/docs/openapi.json
files: docs/openapi.json
- name: Update documentation files
if: steps.changed-files.outputs.test_any_changed == 'true'
if: steps.verify-changed-files.outputs.files_changed == 'true'
env:
SPEC_TO_DISPLAY: "openapi.json"
DISABLE_TRY_IT_OUT_JS_METHOD: "const DisableTryItOutPlugin = function() {return {statePlugins:{spec:{wrapSelectors:{allowTryItOutFor:() => () => false}}}}}"
DISABLE_TRY_IT_OUT_PLUGIN: ", DisableTryItOutPlugin"
run: |
cp -rp node_modules/swagger-ui-dist/* ${{ github.workspace }}/docs
sed -i "/window\.onload\s=\sfunction()\s{/a $DISABLE_TRY_IT_OUT_JS_METHOD" ${{ github.workspace }}/docs/swagger-initializer.js
sed -i "s#https://petstore\.swagger\.io/v2/swagger\.json#$SPEC_TO_DISPLAY#g" ${{ github.workspace }}/docs/swagger-initializer.js
sed -i "/SwaggerUIBundle\.plugins\.DownloadUrl/a $DISABLE_TRY_IT_OUT_PLUGIN" ${{ github.workspace }}/docs/swagger-initializer.js
- name: Commit updated documentation files
yes | cp -rf node_modules/swagger-ui-dist/* docs
sed -i "/window\.onload\s=\sfunction()\s{/a $DISABLE_TRY_IT_OUT_JS_METHOD" docs/swagger-initializer.js
sed -i "s#https://petstore\.swagger\.io/v2/swagger\.json#$SPEC_TO_DISPLAY#g" docs/swagger-initializer.js
sed -i "/SwaggerUIBundle\.plugins\.DownloadUrl/a $DISABLE_TRY_IT_OUT_PLUGIN" docs/swagger-initializer.js
- name: Commit updated documentation files
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: EndBug/add-and-commit@v9
with:
add: ${{ github.workspace }}/docs
add: docs
message: 'chore: update documentation'
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
coverage/
dist/
docs/*
!docs/swagger.cjs
node_modules/
packages/*/example/*.js*
*.map
Expand Down