From e450c6f036e3a18d31f8e6a4032651cb076abe4a Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Mon, 13 Jul 2026 21:59:40 +0200 Subject: [PATCH] Use REST API for changed-files checks --- .github/workflows/codex-preview.yml | 5 +++-- .github/workflows/docs-build.yml | 9 +-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/codex-preview.yml b/.github/workflows/codex-preview.yml index 8814310b..0517013c 100644 --- a/.github/workflows/codex-preview.yml +++ b/.github/workflows/codex-preview.yml @@ -43,8 +43,8 @@ jobs: any_modified: ${{ steps.check-files.outputs.any_modified }} steps: - name: Checkout - # Checkout is needed to get changed files when the event is not a pull request - if: contains(fromJSON('["push", "merge_group", "workflow_dispatch"]'), github.event_name) + # REST API mode is not supported for workflow_dispatch, so keep local git history for manual runs. + if: github.event_name == 'workflow_dispatch' uses: actions/checkout@v6 with: fetch-depth: 2 @@ -53,6 +53,7 @@ jobs: id: check-files uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: + use_rest_api: ${{ contains(fromJSON('["push", "merge_group", "pull_request"]'), github.event_name) }} files: ${{ inputs.path-pattern }} files_ignore: | ${{ inputs.path-pattern-ignore }} diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index d4b36123..33ad4cf8 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -108,19 +108,12 @@ jobs: deleted_files: ${{ steps.check-modified-file-detail.outputs.deleted_files }} renamed_files: ${{ steps.check-modified-file-detail.outputs.renamed_files }} steps: - - name: Checkout - if: contains(fromJSON('["push", "merge_group", "workflow_dispatch"]'), github.event_name) - uses: actions/checkout@v6 - with: - ref: ${{ github.event.pull_request.head.sha || github.ref }} - fetch-depth: 2 - persist-credentials: false - - name: Get changed files if: contains(fromJSON('["push", "merge_group", "pull_request"]'), github.event_name) id: check-files uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: + use_rest_api: true files: ${{ inputs.path-pattern != '' && inputs.path-pattern || '**' }} files_ignore: | ${{ inputs.path-pattern-ignore != '' && inputs.path-pattern-ignore || '' }}