diff --git a/.github/workflows/frontend-deploy-workflow.yml b/.github/workflows/frontend-deploy-workflow.yml index a4327b7..3689aec 100644 --- a/.github/workflows/frontend-deploy-workflow.yml +++ b/.github/workflows/frontend-deploy-workflow.yml @@ -45,6 +45,10 @@ on: default: '["self-hosted", "ci-e2e"]' # Build configuration + pre-build-command: + description: 'Command to run before build (e.g., GraphQL codegen)' + type: string + default: '' build-command: description: 'Production build command' type: string @@ -290,6 +294,12 @@ jobs: jarvis-branch: ${{ inputs.jarvis-branch }} GH_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Run pre-build command + if: inputs.pre-build-command != '' + run: ${{ inputs.pre-build-command }} + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Clean dist directory run: ${{ inputs.clean-command }} diff --git a/.github/workflows/frontend-pr-workflow.yml b/.github/workflows/frontend-pr-workflow.yml index bdf343f..f0c55c4 100644 --- a/.github/workflows/frontend-pr-workflow.yml +++ b/.github/workflows/frontend-pr-workflow.yml @@ -58,6 +58,10 @@ on: default: '[self-hosted, ci-e2e]' # Build configuration + pre-build-command: + description: 'Command to run before linting/build (e.g., GraphQL codegen)' + type: string + default: '' build-command: description: 'Build command to run' type: string @@ -292,6 +296,15 @@ jobs: jarvis-branch: ${{ inputs.jarvis-branch }} GH_TOKEN: ${{ secrets.GH_TOKEN }} + # Runs before linting AND build so that generated files (e.g. GraphQL + # codegen) are available for both TypeScript-aware lint rules and + # build tools like fork-ts-checker-webpack-plugin. + - name: Run pre-build command + if: inputs.pre-build-command != '' + run: ${{ inputs.pre-build-command }} + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Run linting if: inputs.run-linting run: ${{ inputs.lint-command }}