From 56458854cf8862e010dbad0fe2fdbf0c59d813e2 Mon Sep 17 00:00:00 2001 From: Mathieu Veber Date: Mon, 3 Jun 2024 15:29:46 +0200 Subject: [PATCH] feat(redocly): check bundle and run lint --- .github/workflows/redocly.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/redocly.yml diff --git a/.github/workflows/redocly.yml b/.github/workflows/redocly.yml new file mode 100644 index 0000000..c902fb8 --- /dev/null +++ b/.github/workflows/redocly.yml @@ -0,0 +1,37 @@ +name: Redocly + +on: + workflow_call: + secrets: + READONLY_NPM_TOKEN: + description: Needed to install private @hedia npm packages + required: true + +jobs: + redocly: + runs-on: ubuntu-latest + timeout-minutes: 1 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Node.js Environment + uses: actions/setup-node@v4 + with: + always-auth: true + cache: "npm" + node-version-file: package.json + registry-url: https://registry.npmjs.org + scope: "@hedia" + + - name: Install Dependencies + run: npm ci + env: + NODE_AUTH_TOKEN: ${{ secrets.READONLY_NPM_TOKEN }} + + - name: Run Redocly Lint + run: npm run redocly:lint --if-present + + - name: Is the bundle up to date? + run: "npm run redocly:bundle && [[ -n $(git status --porcelain) ]] && exit 1 || :"