diff --git a/src/blocks/blockCTATransitions.test.ts b/src/blocks/blockCTATransitions.test.ts index ed5cf47c9..d20ad3c9d 100644 --- a/src/blocks/blockCTATransitions.test.ts +++ b/src/blocks/blockCTATransitions.test.ts @@ -69,16 +69,17 @@ describe("blockCTATransitions", () => { name: Transition runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - id: checkout + if: (github.actor == 'test-owner' || github.actor == 'renovate[bot]') && startsWith(github.head_ref, 'renovate/') && contains(github.event.pull_request.title, 'create-typescript-app') + uses: actions/checkout@v4 with: fetch-depth: 0 ref: \${{github.event.pull_request.head.ref}} repository: \${{github.event.pull_request.head.repo.full_name}} token: \${{ secrets.ACCESS_TOKEN }} - - id: check - if: (github.actor == 'test-owner' || github.actor == 'renovate[bot]') && startsWith(github.head_ref, 'renovate/') && contains(github.event.pull_request.title, 'create-typescript-app') + - if: steps.checkout.outcome != 'skipped' uses: ./.github/actions/transition - - if: steps.check.outcome == 'skipped' + - if: steps.checkout.outcome == 'skipped' run: echo 'Skipping transition mode because the PR does not appear to be an automated or owner-created update to create-typescript-app.' diff --git a/src/blocks/blockCTATransitions.ts b/src/blocks/blockCTATransitions.ts index 7073a5c69..872018bf5 100644 --- a/src/blocks/blockCTATransitions.ts +++ b/src/blocks/blockCTATransitions.ts @@ -95,6 +95,8 @@ export const blockCTATransitions = base.createBlock({ }, steps: [ { + id: "checkout", + if: `(github.actor == '${options.owner}' || github.actor == 'renovate[bot]') && startsWith(github.head_ref, 'renovate/') && contains(github.event.pull_request.title, 'create-typescript-app')`, uses: resolveUses( "actions/checkout", "v4", @@ -109,12 +111,11 @@ export const blockCTATransitions = base.createBlock({ }, }, { - id: "check", - if: `(github.actor == '${options.owner}' || github.actor == 'renovate[bot]') && startsWith(github.head_ref, 'renovate/') && contains(github.event.pull_request.title, 'create-typescript-app')`, + if: "steps.checkout.outcome != 'skipped'", uses: "./.github/actions/transition", }, { - if: "steps.check.outcome == 'skipped'", + if: "steps.checkout.outcome == 'skipped'", run: "echo 'Skipping transition mode because the PR does not appear to be an automated or owner-created update to create-typescript-app.'", }, ],