From 7bc6e1b09d18ad745a7fbfd96ac861ea3e330b9c Mon Sep 17 00:00:00 2001 From: William So Date: Mon, 19 Jan 2026 15:16:55 +0800 Subject: [PATCH 1/8] chore(ci): prefer hosted runner with self-hosted fallback --- .github/workflows/check-reusable.yml | 62 +++++++++++++++++ .github/workflows/check.yml | 80 ++++------------------ .github/workflows/docker-reusable.yml | 52 ++++++++++++++ .github/workflows/docker.yml | 55 ++++----------- .github/workflows/release-reusable.yml | 75 +++++++++++++++++++++ .github/workflows/release.yml | 93 ++++---------------------- 6 files changed, 225 insertions(+), 192 deletions(-) create mode 100644 .github/workflows/check-reusable.yml create mode 100644 .github/workflows/docker-reusable.yml create mode 100644 .github/workflows/release-reusable.yml diff --git a/.github/workflows/check-reusable.yml b/.github/workflows/check-reusable.yml new file mode 100644 index 0000000..392fc02 --- /dev/null +++ b/.github/workflows/check-reusable.yml @@ -0,0 +1,62 @@ +on: + workflow_call: + inputs: + runs_on: + required: true + type: string + +jobs: + eslint: + runs-on: ${{ inputs.runs_on }} + 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: + runs-on: ${{ inputs.runs_on }} + steps: + - uses: actions/checkout@v4 + + - uses: wagoid/commitlint-github-action@v6 + + tests: + runs-on: ${{ inputs.runs_on }} + steps: + - uses: actions/checkout@v4 + + - 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 test diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2cfd1ed..c2b6916 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -5,71 +5,15 @@ on: - pull_request jobs: - - eslint: - - runs-on: ubuntu-22.04 - - 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: - - runs-on: ubuntu-latest - - steps: - - - uses: actions/checkout@v4 - - - uses: wagoid/commitlint-github-action@v6 - - tests: - - runs-on: ubuntu-latest - - steps: - - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 24 - - # - uses: supercharge/mongodb-github-action@1.11.0 - # with: - # mongodb-version: 7 - - - run: | - corepack enable - corepack install - - - uses: actions/setup-node@v4 - with: - cache: yarn - - - run: | - yarn install - - - run: | - yarn run test + try_checks: + uses: ./.github/workflows/check-reusable.yml + with: + runs_on: "ubuntu-22.04" + continue-on-error: true + + fallback_checks: + needs: [try_checks] + if: needs.try_checks.result == 'failure' + uses: ./.github/workflows/check-reusable.yml + with: + runs_on: '[ "self-hosted", "linux" ]' diff --git a/.github/workflows/docker-reusable.yml b/.github/workflows/docker-reusable.yml new file mode 100644 index 0000000..9f76400 --- /dev/null +++ b/.github/workflows/docker-reusable.yml @@ -0,0 +1,52 @@ +on: + workflow_call: + inputs: + runs_on: + required: true + type: string + +permissions: + contents: read + packages: write + attestations: write + id-token: write + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + docker: + runs-on: ${{ inputs.runs_on }} + steps: + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker Metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha + type=ref,event=branch + type=ref,event=pr + test + + - name: Build and Push + uses: docker/build-push-action@v6 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4a1714d..7f17d30 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,50 +11,19 @@ permissions: id-token: write env: - # Use docker.io for Docker Hub if empty REGISTRY: ghcr.io - # github.repository as / IMAGE_NAME: ${{ github.repository }} jobs: - - docker: - - runs-on: ubuntu-latest - - steps: - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Docker Metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # Commit SHA Tag - # The Tags based on the branch or the PR - # The "test" Tag, indicating a non-production-ready image - tags: | - type=sha - type=ref,event=branch - type=ref,event=pr - test - - - name: Build and Push - uses: docker/build-push-action@v6 - with: - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + try_docker: + uses: ./.github/workflows/docker-reusable.yml + with: + runs_on: "ubuntu-latest" + continue-on-error: true + + fallback_docker: + needs: [try_docker] + if: needs.try_docker.result == 'failure' + uses: ./.github/workflows/docker-reusable.yml + with: + runs_on: '[ "self-hosted", "linux" ]' diff --git a/.github/workflows/release-reusable.yml b/.github/workflows/release-reusable.yml new file mode 100644 index 0000000..8a486a9 --- /dev/null +++ b/.github/workflows/release-reusable.yml @@ -0,0 +1,75 @@ +on: + workflow_call: + inputs: + runs_on: + required: true + type: string + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + release: + runs-on: ${{ inputs.runs_on }} + steps: + - name: Release Please + uses: googleapis/release-please-action@v4 + id: release + with: + release-type: node + + - name: Checkout + uses: actions/checkout@v4 + if: ${{ steps.release.outputs.release_created }} + + - name: Tag Major and Minor Versions + if: ${{ steps.release.outputs.release_created }} + run: | + git config user.name github-actions[bot] + git config user.email github-actions[bot]@users.noreply.github.com + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" + git tag -d v${{ steps.release.outputs.major }} || true + git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git push origin :v${{ steps.release.outputs.major }} || true + git push origin v${{ steps.release.outputs.major }} + git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} + + - name: Setup QEMU + if: ${{ steps.release.outputs.release_created }} + uses: docker/setup-qemu-action@v3 + + - name: Setup Docker Buildx + if: ${{ steps.release.outputs.release_created }} + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + if: ${{ steps.release.outputs.release_created }} + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker Metadata + if: ${{ steps.release.outputs.release_created }} + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha + type=ref,event=branch + prod + ${{ steps.release.outputs.major }} + ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} + ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} + + - name: Build and Push + if: ${{ steps.release.outputs.release_created }} + uses: docker/build-push-action@v6 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c89801..f7b5539 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,85 +11,16 @@ permissions: pull-requests: write packages: write -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} - jobs: - - release-please: - - runs-on: ubuntu-latest - - steps: - - - name: Release Please - uses: googleapis/release-please-action@v4 - id: release - with: - release-type: node - - # From: - # https://github.com/googleapis/release-please-action?tab=readme-ov-file#creating-majorminor-tags - - name: Checkout - uses: actions/checkout@v4 - if: ${{ steps.release.outputs.release_created }} - - name: Tag Major and Minor Versions - if: ${{ steps.release.outputs.release_created }} - run: | - git config user.name github-actions[bot] - git config user.email github-actions[bot]@users.noreply.github.com - git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" - git tag -d v${{ steps.release.outputs.major }} || true - git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true - git push origin :v${{ steps.release.outputs.major }} || true - git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true - git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" - git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" - git push origin v${{ steps.release.outputs.major }} - git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} - - - name: Setup QEMU - if: ${{ steps.release.outputs.release_created }} - uses: docker/setup-qemu-action@v3 - - - name: Setup Docker Buildx - if: ${{ steps.release.outputs.release_created }} - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - if: ${{ steps.release.outputs.release_created }} - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Docker Metadata - if: ${{ steps.release.outputs.release_created }} - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # Commit SHA Tag - # The Tag based on the branch (main) - # The "prod" Tag, indicating a production-ready image - # The Major, Major.Minor, and Major.Minor.Patch tags - tags: | - type=sha - type=ref,event=branch - prod - ${{ steps.release.outputs.major }} - ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} - ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} - - - name: Build and Push - if: ${{ steps.release.outputs.release_created }} - uses: docker/build-push-action@v6 - with: - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + try_release_please: + uses: ./.github/workflows/release-reusable.yml + with: + runs_on: "ubuntu-latest" + continue-on-error: true + + fallback_release_please: + needs: [try_release_please] + if: needs.try_release_please.result == 'failure' + uses: ./.github/workflows/release-reusable.yml + with: + runs_on: '[ "self-hosted", "linux" ]' From 045c292d96af0afd526b9b0bf7e38837b395dcee Mon Sep 17 00:00:00 2001 From: William So Date: Mon, 19 Jan 2026 15:21:50 +0800 Subject: [PATCH 2/8] fix(ci): move continue-on-error to callers of shared steps --- .github/workflows/check.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index c2b6916..d9e7269 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -7,9 +7,9 @@ on: jobs: try_checks: uses: ./.github/workflows/check-reusable.yml + continue-on-error: true with: runs_on: "ubuntu-22.04" - continue-on-error: true fallback_checks: needs: [try_checks] diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7f17d30..2d37165 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,9 +17,9 @@ env: jobs: try_docker: uses: ./.github/workflows/docker-reusable.yml + continue-on-error: true with: runs_on: "ubuntu-latest" - continue-on-error: true fallback_docker: needs: [try_docker] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7b5539..7581c71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,9 +14,9 @@ permissions: jobs: try_release_please: uses: ./.github/workflows/release-reusable.yml + continue-on-error: true with: runs_on: "ubuntu-latest" - continue-on-error: true fallback_release_please: needs: [try_release_please] From 5cda12cd3aa8fe166b8d55f0eccb9810ecdcdaa7 Mon Sep 17 00:00:00 2001 From: William So Date: Mon, 19 Jan 2026 15:43:23 +0800 Subject: [PATCH 3/8] fix(ci): pass continue_on_error to shared steps and remove invalid job-level flag --- .github/workflows/check-reusable.yml | 7 +++++++ .github/workflows/check.yml | 2 +- .github/workflows/docker-reusable.yml | 5 +++++ .github/workflows/docker.yml | 2 +- .github/workflows/release-reusable.yml | 5 +++++ .github/workflows/release.yml | 2 +- 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-reusable.yml b/.github/workflows/check-reusable.yml index 392fc02..99875a0 100644 --- a/.github/workflows/check-reusable.yml +++ b/.github/workflows/check-reusable.yml @@ -4,10 +4,15 @@ on: runs_on: required: true type: string + continue_on_error: + required: false + type: boolean + default: false jobs: eslint: runs-on: ${{ inputs.runs_on }} + continue-on-error: ${{ inputs.continue_on_error }} steps: - uses: actions/checkout@v4 with: @@ -33,6 +38,7 @@ jobs: commitlint: runs-on: ${{ inputs.runs_on }} + continue-on-error: ${{ inputs.continue_on_error }} steps: - uses: actions/checkout@v4 @@ -40,6 +46,7 @@ jobs: tests: runs-on: ${{ inputs.runs_on }} + continue-on-error: ${{ inputs.continue_on_error }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d9e7269..e483a9c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -7,9 +7,9 @@ on: jobs: try_checks: uses: ./.github/workflows/check-reusable.yml - continue-on-error: true with: runs_on: "ubuntu-22.04" + continue_on_error: true fallback_checks: needs: [try_checks] diff --git a/.github/workflows/docker-reusable.yml b/.github/workflows/docker-reusable.yml index 9f76400..0cfe749 100644 --- a/.github/workflows/docker-reusable.yml +++ b/.github/workflows/docker-reusable.yml @@ -4,6 +4,10 @@ on: runs_on: required: true type: string + continue_on_error: + required: false + type: boolean + default: false permissions: contents: read @@ -18,6 +22,7 @@ env: jobs: docker: runs-on: ${{ inputs.runs_on }} + continue-on-error: ${{ inputs.continue_on_error }} steps: - name: Setup QEMU uses: docker/setup-qemu-action@v3 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2d37165..81fd490 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,9 +17,9 @@ env: jobs: try_docker: uses: ./.github/workflows/docker-reusable.yml - continue-on-error: true with: runs_on: "ubuntu-latest" + continue_on_error: true fallback_docker: needs: [try_docker] diff --git a/.github/workflows/release-reusable.yml b/.github/workflows/release-reusable.yml index 8a486a9..22078d3 100644 --- a/.github/workflows/release-reusable.yml +++ b/.github/workflows/release-reusable.yml @@ -4,6 +4,10 @@ on: runs_on: required: true type: string + continue_on_error: + required: false + type: boolean + default: false env: REGISTRY: ghcr.io @@ -12,6 +16,7 @@ env: jobs: release: runs-on: ${{ inputs.runs_on }} + continue-on-error: ${{ inputs.continue_on_error }} steps: - name: Release Please uses: googleapis/release-please-action@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7581c71..fe6a0c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,9 +14,9 @@ permissions: jobs: try_release_please: uses: ./.github/workflows/release-reusable.yml - continue-on-error: true with: runs_on: "ubuntu-latest" + continue_on_error: true fallback_release_please: needs: [try_release_please] From b24a487fe6f61df922dd17a0c9e65fd8dfaad47a Mon Sep 17 00:00:00 2001 From: William So Date: Mon, 19 Jan 2026 16:16:20 +0800 Subject: [PATCH 4/8] fix(ci): use `failure()` condition for fallback jobs --- .github/workflows/check.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e483a9c..68b59f3 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -13,7 +13,7 @@ jobs: fallback_checks: needs: [try_checks] - if: needs.try_checks.result == 'failure' + if: ${{ failure() }} uses: ./.github/workflows/check-reusable.yml with: runs_on: '[ "self-hosted", "linux" ]' diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 81fd490..4281c84 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,7 +23,7 @@ jobs: fallback_docker: needs: [try_docker] - if: needs.try_docker.result == 'failure' + if: ${{ failure() }} uses: ./.github/workflows/docker-reusable.yml with: runs_on: '[ "self-hosted", "linux" ]' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe6a0c8..7866780 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: fallback_release_please: needs: [try_release_please] - if: needs.try_release_please.result == 'failure' + if: ${{ failure() }} uses: ./.github/workflows/release-reusable.yml with: runs_on: '[ "self-hosted", "linux" ]' From b8940f27b63e296d583ebeed15180763ffd6628c Mon Sep 17 00:00:00 2001 From: William So Date: Mon, 19 Jan 2026 16:36:16 +0800 Subject: [PATCH 5/8] docs(ci): explain PR UI duplication and cosmetic failure artifacts --- .github/workflows/check.yml | 8 ++++++++ .github/workflows/docker.yml | 8 ++++++++ .github/workflows/release.yml | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 68b59f3..252dc7f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,6 +12,14 @@ jobs: continue_on_error: true fallback_checks: + # NOTE: This fallback job runs only when the `try_checks` job fails. + # + # Because both the try and fallback invoke the same reusable workflow, the + # GitHub PR UI may display duplicated or expanded workflow sections. In + # addition, using `continue-on-error` inside the reusable jobs can make + # checks appear as failed in the PR interface even though the fallback + # subsequently handled the failure. This is a cosmetic artifact of the + # try→fallback pattern and does not indicate a functional regression. needs: [try_checks] if: ${{ failure() }} uses: ./.github/workflows/check-reusable.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4281c84..95bba4a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -22,6 +22,14 @@ jobs: continue_on_error: true fallback_docker: + # NOTE: This fallback job runs only when the `try_docker` job fails. + # + # Because both the try and fallback invoke the same reusable workflow, the + # GitHub PR UI may display duplicated or expanded workflow sections. In + # addition, using `continue-on-error` inside the reusable jobs can make + # checks appear as failed in the PR interface even though the fallback + # subsequently handled the failure. This is a cosmetic artifact of the + # try→fallback pattern and does not indicate a functional regression. needs: [try_docker] if: ${{ failure() }} uses: ./.github/workflows/docker-reusable.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7866780..8f66288 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,14 @@ jobs: continue_on_error: true fallback_release_please: + # NOTE: This fallback job runs only when the `try_release_please` job fails. + # + # Because both the try and fallback invoke the same reusable workflow, the + # GitHub PR UI may display duplicated or expanded workflow sections. In + # addition, using `continue-on-error` inside the reusable jobs can make + # checks appear as failed in the PR interface even though the fallback + # subsequently handled the failure. This is a cosmetic artifact of the + # try→fallback pattern and does not indicate a functional regression. needs: [try_release_please] if: ${{ failure() }} uses: ./.github/workflows/release-reusable.yml From c1f5f35f3b37a0e5873c90222c0be31e2f7cb886 Mon Sep 17 00:00:00 2001 From: William So Date: Mon, 19 Jan 2026 16:40:37 +0800 Subject: [PATCH 6/8] fix(ci): use `self-hosted` runner label for fallback --- .github/workflows/check.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 252dc7f..96a2e01 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -24,4 +24,4 @@ jobs: if: ${{ failure() }} uses: ./.github/workflows/check-reusable.yml with: - runs_on: '[ "self-hosted", "linux" ]' + runs_on: "self-hosted" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 95bba4a..247b818 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -34,4 +34,4 @@ jobs: if: ${{ failure() }} uses: ./.github/workflows/docker-reusable.yml with: - runs_on: '[ "self-hosted", "linux" ]' + runs_on: "self-hosted" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f66288..4e0a452 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,4 +31,4 @@ jobs: if: ${{ failure() }} uses: ./.github/workflows/release-reusable.yml with: - runs_on: '[ "self-hosted", "linux" ]' + runs_on: "self-hosted" From 67b15082f30ccd8eb4c9b8bd938ed83490b7ef0b Mon Sep 17 00:00:00 2001 From: William So Date: Wed, 21 Jan 2026 10:31:14 +0800 Subject: [PATCH 7/8] chore(ci): move reuse into `*-shared-steps.yml` and update callers --- .../workflows/{check-reusable.yml => check-shared-steps.yml} | 5 +++++ .github/workflows/check.yml | 4 ++-- .../{docker-reusable.yml => docker-shared-steps.yml} | 5 +++++ .github/workflows/docker.yml | 4 ++-- .../{release-reusable.yml => release-shared-steps.yml} | 5 +++++ .github/workflows/release.yml | 4 ++-- 6 files changed, 21 insertions(+), 6 deletions(-) rename .github/workflows/{check-reusable.yml => check-shared-steps.yml} (79%) rename .github/workflows/{docker-reusable.yml => docker-shared-steps.yml} (79%) rename .github/workflows/{release-reusable.yml => release-shared-steps.yml} (89%) diff --git a/.github/workflows/check-reusable.yml b/.github/workflows/check-shared-steps.yml similarity index 79% rename from .github/workflows/check-reusable.yml rename to .github/workflows/check-shared-steps.yml index 99875a0..50fc1f5 100644 --- a/.github/workflows/check-reusable.yml +++ b/.github/workflows/check-shared-steps.yml @@ -1,3 +1,8 @@ +## NOTE: This workflow contains shared steps used by an internal try→fallback +## pattern inside this repository. It's named `*-shared-steps.yml` to make it +## clear these are shared step definitions for local use (not a broadly +## reusable/cross-repo workflow). Keep the file paired with the callers that +## run it twice (try + fallback). on: workflow_call: inputs: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 96a2e01..6114d6f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -6,7 +6,7 @@ on: jobs: try_checks: - uses: ./.github/workflows/check-reusable.yml + uses: ./.github/workflows/check-shared-steps.yml with: runs_on: "ubuntu-22.04" continue_on_error: true @@ -22,6 +22,6 @@ jobs: # try→fallback pattern and does not indicate a functional regression. needs: [try_checks] if: ${{ failure() }} - uses: ./.github/workflows/check-reusable.yml + uses: ./.github/workflows/check-shared-steps.yml with: runs_on: "self-hosted" diff --git a/.github/workflows/docker-reusable.yml b/.github/workflows/docker-shared-steps.yml similarity index 79% rename from .github/workflows/docker-reusable.yml rename to .github/workflows/docker-shared-steps.yml index 0cfe749..5ffb064 100644 --- a/.github/workflows/docker-reusable.yml +++ b/.github/workflows/docker-shared-steps.yml @@ -1,3 +1,8 @@ +## NOTE: This workflow contains shared steps used by an internal try→fallback +## pattern inside this repository. It's named `*-shared-steps.yml` to make it +## clear these are shared step definitions for local use (not a broadly +## reusable/cross-repo workflow). Keep the file paired with the callers that +## run it twice (try + fallback). on: workflow_call: inputs: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 247b818..9c7700f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -16,7 +16,7 @@ env: jobs: try_docker: - uses: ./.github/workflows/docker-reusable.yml + uses: ./.github/workflows/docker-shared-steps.yml with: runs_on: "ubuntu-latest" continue_on_error: true @@ -32,6 +32,6 @@ jobs: # try→fallback pattern and does not indicate a functional regression. needs: [try_docker] if: ${{ failure() }} - uses: ./.github/workflows/docker-reusable.yml + uses: ./.github/workflows/docker-shared-steps.yml with: runs_on: "self-hosted" diff --git a/.github/workflows/release-reusable.yml b/.github/workflows/release-shared-steps.yml similarity index 89% rename from .github/workflows/release-reusable.yml rename to .github/workflows/release-shared-steps.yml index 22078d3..eb9ac95 100644 --- a/.github/workflows/release-reusable.yml +++ b/.github/workflows/release-shared-steps.yml @@ -1,3 +1,8 @@ +## NOTE: This workflow contains shared steps used by an internal try→fallback +## pattern inside this repository. It's named `*-shared-steps.yml` to make it +## clear these are shared step definitions for local use (not a broadly +## reusable/cross-repo workflow). Keep the file paired with the callers that +## run it twice (try + fallback). on: workflow_call: inputs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e0a452..8fa3830 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ permissions: jobs: try_release_please: - uses: ./.github/workflows/release-reusable.yml + uses: ./.github/workflows/release-shared-steps.yml with: runs_on: "ubuntu-latest" continue_on_error: true @@ -29,6 +29,6 @@ jobs: # try→fallback pattern and does not indicate a functional regression. needs: [try_release_please] if: ${{ failure() }} - uses: ./.github/workflows/release-reusable.yml + uses: ./.github/workflows/release-shared-steps.yml with: runs_on: "self-hosted" From 317405e210a9c6b97dbfdcab88f01f723deeeb4f Mon Sep 17 00:00:00 2001 From: William So Date: Wed, 21 Jan 2026 10:33:32 +0800 Subject: [PATCH 8/8] chore(ci): add MongoDB service to tests job --- .github/workflows/check-shared-steps.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-shared-steps.yml b/.github/workflows/check-shared-steps.yml index 50fc1f5..d9dee49 100644 --- a/.github/workflows/check-shared-steps.yml +++ b/.github/workflows/check-shared-steps.yml @@ -59,6 +59,10 @@ jobs: with: node-version: 24 + - uses: supercharge/mongodb-github-action@1.11.0 + with: + mongodb-version: 7 + - run: | corepack enable corepack install