ReDoc #844
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ReDoc | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
jobs: | |
redoc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Get ReDoc Version | |
id: redoc-version | |
run: echo "::set-output name=version::$(npm show redoc version)" | |
- name: Update ReDoc | |
run: | | |
url="https://cdn.redoc.ly/redoc/v${{ steps.redoc-version.outputs.version }}/bundles/redoc.standalone.js" | |
sri="$(wget -qO- "$url" | sha512sum | awk '{print $1}' | fold -b2 | while read line; do printf "\x$line"; done | base64 -w0)" | |
cd redoc/src | |
sed -i script.ts \ | |
-e "s|REDOC_URL =[^;]*;|REDOC_URL = \"$url\";|" \ | |
-e "s|REDOC_SRI =[^;]*;|REDOC_SRI = \"$sri\";|" | |
npm install | |
npm run webpack | |
- uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVKEY }} | |
- uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
commit-message: Update ReDoc version to ${{ steps.redoc-version.outputs.version }} | |
title: Update ReDoc version to ${{ steps.redoc-version.outputs.version }} | |
author: gotham-restful-bot[bot] <82609003+gotham-restful-bot[bot]@users.noreply.github.com> | |
committer: gotham-restful-bot[bot] <82609003+gotham-restful-bot[bot]@users.noreply.github.com> | |
branch: redoc-${{ steps.redoc-version.outputs.version }} | |
labels: dependencies | |
reviewers: msrd0 | |
body: | | |
Updates the linked version of ReDoc to ${{ steps.redoc-version.outputs.version }} | |
<sub>Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action</sub> |