Skip to content

ci(workflows): add workflow_dispatch to all workflows #256

ci(workflows): add workflow_dispatch to all workflows

ci(workflows): add workflow_dispatch to all workflows #256

Workflow file for this run

name: Checks
on:
push:
pull_request:
workflow_dispatch:
# Minimal file-level permissions for checks: read repository contents for linting/tests
permissions:
contents: read
jobs:
detect-quota:
# Probe the hosted runner (same flavor as the original try job) so we
# can decide whether to use a hosted runner or fall back to
# self-hosted. The job should fail if quota is exhausted.
permissions: {}
runs-on: ubuntu-slim
steps:
- name: Quota probe
id: quota_probe
run: |
echo "probe"
# NOTE: Do not set `continue-on-error: true` on the `detect-quota` job.
# If `continue-on-error` is enabled the job result will always be
# 'success', which defeats detection (we rely on `needs.detect-quota.result`).
# Unfortunately this means the workflow may be reported as failed if the
# hosted runner is unavailable. We cannot work around this until GitHub
# provides a job-level "allow-failure"/neutral-conclusion feature
# (see: https://github.com/actions/runner/issues/2347 for discussion).
eslint:
# ESLint job inlined from check-shared-steps.yml
needs: detect-quota
if: ${{ always() }}
runs-on: ${{ needs.detect-quota.result == 'success' && 'ubuntu-slim' || 'self-hosted' }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 24
- run: |
corepack enable
corepack install
- uses: actions/setup-node@v4
with:
cache: yarn
- run: |
yarn install
- run: |
yarn run lint
commitlint:
# Commitlint job inlined from check-shared-steps.yml
needs: detect-quota
if: ${{ always() }}
runs-on: ${{ needs.detect-quota.result == 'success' && 'ubuntu-latest' || 'self-hosted' }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v6
tests:
# Tests job inlined from check-shared-steps.yml
needs: detect-quota
if: ${{ always() }}
runs-on: ${{ needs.detect-quota.result == 'success' && 'ubuntu-latest' || 'self-hosted' }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: supercharge/mongodb-github-action@1.12.1
with:
mongodb-version: 7
- run: |
corepack enable
corepack install
- uses: actions/setup-node@v4
with:
cache: yarn
- run: |
yarn install
- run: |
yarn run test