Skip to content

ReDoc

ReDoc #1307

Workflow file for this run

name: ReDoc
on:
schedule:
- cron: '0 4 * * *'
jobs:
redoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
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@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVKEY }}
- uses: peter-evans/create-pull-request@v6
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>