diff --git a/.github/workflows/tusk-sanity-check.yml b/.github/workflows/tusk-sanity-check.yml new file mode 100755 index 0000000000000000000000000000000000000000..4bd7e88e4120e03893d5b8e7df8353324c89bf9a --- /dev/null +++ b/.github/workflows/tusk-sanity-check.yml @@ -0,0 +1,60 @@ +# This allows Tusk to manually run workflows to check lint/build/tests before creating a PR. +# If you have any questions, please reach out to support@usetusk.ai. + +name: Tusk Sanity Check + +on: + workflow_dispatch: + inputs: + taskId: + description: "Tusk Task ID" + required: true + runType: + description: "Tusk Run Type" + required: true + runId: + description: "Tusk Run ID" + required: true + +jobs: + sanity_check: + runs-on: ubuntu-latest + steps: + - name: Log inputs + run: | + echo "Tusk Task ID: ${{ github.event.inputs.taskId }}" + echo "Tusk Run Type: ${{ github.event.inputs.runType }}" + echo "Tusk Run ID: ${{ github.event.inputs.runId }}" + echo "Current Branch: ${{ github.ref }}" + echo "Repository default branch: ${{ github.event.repository.default_branch }}" + + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + fetch-depth: 0 + + - name: Check which files changed + uses: dorny/paths-filter@v3.0.0 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-paths.yaml + + - name: Prepare front-end environment + if: steps.changes.outputs.frontend_all == 'true' + uses: ./.github/actions/prepare-frontend + + - name: Run lint-staged + if: steps.changes.outputs.frontend_all == 'true' + run: yarn lint-staged --diff=origin/${{ github.event.repository.default_branch }} + + # You must include this step after running all auto-fixing steps + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "fix(${{ github.run_id }}): auto linting" # The commit message MUST start with "fix(${{ github.run_id }}):" + skip_fetch: true + skip_checkout: true + + - name: Check types + if: steps.changes.outputs.frontend_all == 'true' + run: yarn type-check-pure