-
Notifications
You must be signed in to change notification settings - Fork 600
51 lines (48 loc) · 2.05 KB
/
update-openapi-ui.yml
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
# Update the dependencies of the OpenAPI UI and rebuild it, then create a pull request with the changes
name: Update OpenAPI UI dependencies
on: workflow_dispatch
jobs:
update-openapi-ui:
name: Update OpenAPI UI Dependencies
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dev/com.ibm.ws.openapi.ui/swagger-ui
steps:
- name: Checkout Open Liberty
uses: actions/checkout@v2
- name: Use Node.js v16
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: ./dev/com.ibm.ws.openapi.ui/swagger-ui/package-lock.json
- name: Update OpenAPI UI dependencies
run: |
npx --yes npm-check-updates -u
npm update
- name: Find new Swagger UI version
run: |
export SWAGGER_UI_VERSION=$(jq -r '.packages."node_modules/swagger-ui".version' package-lock.json)
echo "SWAGGER_UI_VERSION=$SWAGGER_UI_VERSION" >> $GITHUB_ENV
echo "Swagger UI version: $SWAGGER_UI_VERSION"
- name: Copy SCSS from Swagger UI source
run: |
git clone --depth 1 -b v${SWAGGER_UI_VERSION} https://github.com/swagger-api/swagger-ui.git swagger-ui-src
rm src/style/original/*
cp swagger-ui-src/src/style/* src/style/original
rm -r swagger-ui-src
- name: Build OpenAPI UI
run: npm run build -- --mode=production
- name: Create Pull Request
uses: peter-evans/create-pull-request@18f7dc018cc2cd597073088f7c7591b9d1c02672 #3.14.0
id: create-pr
with:
branch: update-swagger-ui-${{ env.SWAGGER_UI_VERSION }}
title: Update Swagger UI to ${{ env.SWAGGER_UI_VERSION }}
commit-message: Update Swagger UI to ${{ env.SWAGGER_UI_VERSION }} [auto]
body: Update Swagger UI and its dependencies and rebuild the OpenAPI UI
labels: in:MicroProfile/OpenAPI, team:MicroprofileUK
- name: Created PR information
if: ${{ steps.create-pr.outputs.pull-request-number }}
run: 'echo "Pull Request created: ${{ steps.create-pr.outputs.pull-request-url }}"'