From 8d63466e30cdce7d12878ba5faff74a367cefc3a Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 12 Sep 2022 12:47:03 -0700 Subject: [PATCH 1/2] Update twoslash workflow --- .github/workflows/twoslash-repros.yaml | 27 ++++++++++---------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/twoslash-repros.yaml b/.github/workflows/twoslash-repros.yaml index 3ff59cf2e56e2..a8abb3a241f7e 100644 --- a/.github/workflows/twoslash-repros.yaml +++ b/.github/workflows/twoslash-repros.yaml @@ -8,35 +8,28 @@ on: - cron: '0 8 * * *' repository_dispatch: types: run-twoslash-repros - issues: - types: - - labeled workflow_dispatch: inputs: - bisect_issue: - description: Triggers a bisect request on the given issue number instead of updating repros on all issues + issue: + description: Limits run to a single issue. + required: false + type: string + bisect: + description: If set, runs a git bisect on an existing repro. Requires 'issue' to be set. Value can be revision labels (e.g. `good v4.7.3 bad main`) or `true` to infer bisect range. required: false type: string jobs: run: - if: ${{ github.repository == 'microsoft/TypeScript' && !github.event.label && !github.event.inputs.bisect_issue }} - runs-on: ubuntu-latest - steps: - - uses: actions/setup-node@v3 - - uses: microsoft/TypeScript-Twoslash-Repro-Action@master - with: - github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - - bisect: - if: ${{ github.event.label.name == 'Bisect Repro' || github.event.inputs.bisect_issue }} + if: ${{ github.repository == 'microsoft/TypeScript' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: - fetch-depth: 0 + fetch-depth: ${{ github.events.input.bisect && '0' || '1' }} - uses: actions/setup-node@v3 - uses: microsoft/TypeScript-Twoslash-Repro-Action@master with: github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} - bisect: ${{ github.event.issue.number || github.event.inputs.bisect_issue }} + issue: ${{ github.event.inputs.issue }} + bisect: ${{ github.event.inputs.bisect }} From 92fbbf84679983168d005cde9c28d94802fcca17 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 12 Sep 2022 13:31:55 -0700 Subject: [PATCH 2/2] Split conditional checkout --- .github/workflows/twoslash-repros.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/twoslash-repros.yaml b/.github/workflows/twoslash-repros.yaml index a8abb3a241f7e..55e27dc00a579 100644 --- a/.github/workflows/twoslash-repros.yaml +++ b/.github/workflows/twoslash-repros.yaml @@ -24,9 +24,12 @@ jobs: if: ${{ github.repository == 'microsoft/TypeScript' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - if: ${{ github.events.input.bisect }} + uses: actions/checkout@v3 with: - fetch-depth: ${{ github.events.input.bisect && '0' || '1' }} + fetch-depth: 0 + - if: ${{ !github.events.input.bisect }} + uses: actions/checkout@v3 - uses: actions/setup-node@v3 - uses: microsoft/TypeScript-Twoslash-Repro-Action@master with: