Skip to content

fix: skip checkout in CTA action before transition step #2215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/blocks/blockCTATransitions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.'


Expand Down
7 changes: 4 additions & 3 deletions src/blocks/blockCTATransitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.'",
},
],
Expand Down