Skip to content

chore: improvements to various ci workflows#300

Merged
james-elicx merged 2 commits intomainfrom
james/improve-workflows
Mar 6, 2026
Merged

chore: improvements to various ci workflows#300
james-elicx merged 2 commits intomainfrom
james/improve-workflows

Conversation

@james-elicx
Copy link
Copy Markdown
Collaborator

@james-elicx james-elicx commented Mar 6, 2026

  • Fix tip.yml spurious runs - invalid ${{ }} wrapper on secrets if: check caused GitHub to fire the workflow on every push
  • Fix benchmarks.yml broken install - cd ../vinext in a run: block resolves from repo root, not previous directory; use npm install --prefix instead
  • Gate publish and preview-release on repository_owner == 'cloudflare'
  • Fix ci.yml concurrency group to include event_name, preventing push and PR runs from cancelling each other
  • Fix deploy-preview-command.yml: add --frozen-lockfile; only post preview URLs when deploy succeeds

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 6, 2026

Open in StackBlitz

npm i https://pkg.pr.new/vinext@300

commit: 16b782d

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original

@james-elicx
Copy link
Copy Markdown
Collaborator Author

/bigbonk review

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All six fixes look correct.

tip.yml${{ secrets.X != '' }} in an if: is evaluated as a string expression (always truthy), not a secrets check. Removing the ${{ }} wrapper lets GitHub evaluate it as a native workflow expression where secrets are accessible. Good catch.

benchmarks.yml — Each run: block starts in GITHUB_WORKSPACE, so the chained cd approach (cd benchmarks/nextjs && npm install; cd ../vinext && ...) was broken because each cd is relative to the repo root, not the previous directory. Actually — the original used newlines not &&, so each line ran from the repo root, meaning the first cd benchmarks/nextjs && npm install worked, but cd ../vinext resolved to <repo-root>/../vinext which doesn't exist. --prefix is the clean fix.

ci.yml — Without event_name in the concurrency group, a push to main (triggered by merging a PR) and a simultaneous PR run would share the same group key (ci-refs/heads/main vs ci-refs/pull/N/merge — wait, actually those refs are already different). The real scenario this fixes: a push to main triggers both a push event and can still have an in-flight pull_request event for the same ref. With event_name included, they no longer collide. Correct.

deploy-preview-command.yml — Two good fixes: --frozen-lockfile ensures reproducible installs in CI (was the only workflow missing it), and the if: always() && needs.check.result == 'success' && needs.deploy.result == 'success' on the comment job prevents posting preview URLs when the deploy actually failed. The always() is needed because without it the job would be skipped when any upstream job fails (default behavior), but with it plus the explicit success checks, it only runs when everything succeeded — which is the desired behavior.

preview-release.yml / publish.yml — Gating on repository_owner == 'cloudflare' prevents fork PRs from attempting to run pkg-pr-new (which would fail without write access) and prevents publish from running in fork contexts. Sensible guard.

Clean PR, all changes are minimal and targeted.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Mar 6, 2026

PR approved. All six workflow fixes are correct and well-targeted. Here's the summary:

File Fix Verdict
tip.yml Remove ${{ }} wrapper on secrets if: check — was always truthy as a string expression Correct
benchmarks.yml Replace chained cd with npm install --prefixcd ../vinext from repo root doesn't resolve correctly Correct
ci.yml Add event_name to concurrency group — prevents push and PR runs from cancelling each other Correct
deploy-preview-command.yml Add --frozen-lockfile; gate comment job on deploy success Correct
preview-release.yml Gate on repository_owner == 'cloudflare' — skip for forks Correct
publish.yml Same fork guard for the publish job Correct

github run

@james-elicx james-elicx marked this pull request as ready for review March 6, 2026 12:31
@james-elicx james-elicx merged commit 49aaa2a into main Mar 6, 2026
23 checks passed
@james-elicx james-elicx deleted the james/improve-workflows branch March 6, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant