diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index dd706fa..4c32913 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -23,32 +23,10 @@ permissions: pull-requests: 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 - timeout-minutes: 1 - 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). + # `vars.ACTIONS_RUNNER_TYPE` is set on private repositories only. lint-fmt: - # ESLint job inlined from check-shared-steps.yml - needs: detect-quota - if: ${{ always() }} - runs-on: ${{ needs.detect-quota.result == 'success' && 'ubuntu-slim' || 'self-hosted' }} + runs-on: ${{ vars.ACTIONS_RUNNER_TYPE || 'ubuntu-latest' }} timeout-minutes: 5 continue-on-error: true steps: @@ -76,10 +54,8 @@ jobs: yarn fmt:check commitlint: - # Commitlint job inlined from check-shared-steps.yml - needs: detect-quota - if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - runs-on: ${{ needs.detect-quota.result == 'success' && 'ubuntu-latest' || 'self-hosted' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + runs-on: ${{ vars.ACTIONS_RUNNER_TYPE || 'ubuntu-latest' }} timeout-minutes: 2 continue-on-error: true steps: @@ -88,10 +64,7 @@ jobs: - 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' }} + runs-on: ${{ vars.ACTIONS_RUNNER_TYPE || 'ubuntu-latest' }} timeout-minutes: 5 continue-on-error: true steps: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index edeefa8..4345ed3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,31 +28,10 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - detect-quota: - # Probe the hosted runner to decide whether to use hosted runners or - # fall back to self-hosted. Use the same runner flavor as the original - # try job. - permissions: {} - runs-on: ubuntu-slim - timeout-minutes: 1 - 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). + # `vars.ACTIONS_RUNNER_TYPE` is set on private repositories only. docker: - needs: detect-quota - if: ${{ always() }} - runs-on: ${{ needs.detect-quota.result == 'success' && 'ubuntu-latest' || 'self-hosted' }} + runs-on: ${{ vars.ACTIONS_RUNNER_TYPE || 'ubuntu-latest' }} timeout-minutes: 5 continue-on-error: true steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ce03dc..ac085ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,30 +19,10 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - detect-quota: - # Probe the hosted runner flavor used by release steps so we can fall - # back if necessary. - permissions: {} - runs-on: ubuntu-slim - timeout-minutes: 1 - 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). + # `vars.ACTIONS_RUNNER_TYPE` is set on private repositories only. release_please: - needs: detect-quota - if: ${{ always() }} - runs-on: ${{ needs.detect-quota.result == 'success' && 'ubuntu-latest' || 'self-hosted' }} + runs-on: ${{ vars.ACTIONS_RUNNER_TYPE || 'ubuntu-latest' }} timeout-minutes: 5 continue-on-error: true