Skip to content

infra(unicorn): import-style #7114

infra(unicorn): import-style

infra(unicorn): import-style #7114

Workflow file for this run

name: PR
on:
pull_request:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
check-code-generation:
runs-on: ubuntu-latest
timeout-minutes: 10
name: 'Check Code Generation: node-20, ubuntu-latest'
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Set node version to 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'pnpm'
- name: Install deps
run: pnpm install
env:
CYPRESS_INSTALL_BINARY: 0
- name: Generate code
id: generate
run: |
pnpm run generate:locales
pnpm run generate:api-docs
pnpm run build
pnpm run test -u
continue-on-error: true
env:
CI_PREFLIGHT: true
- name: Check diff
id: diff
run: |
git add .
git diff --cached --name-only | sed -E 's/^(.*)$/::error file=\1,title=Diff detected::Please run `pnpm run preflight` and commit the changes./'
git diff --cached --name-only --exit-code
continue-on-error: true
- name: Transpile ts
run: pnpm tsup-node .github/workflows/commentCodeGeneration.ts --format cjs --clean false --out-dir .github/workflows
- name: Comment
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { script } = require('${{ github.workspace }}/.github/workflows/commentCodeGeneration.cjs')
await script(github, context, ${{ steps.generate.outcome == 'success' && steps.diff.outcome == 'success' }})
- name: Status
if: ${{ steps.generate.outcome == 'failure' || steps.diff.outcome == 'failure' }}
run: exit 1