Skip to content

Canary: Auto trigger canary release based on branch name ending#32258

Merged
ndelangen merged 1 commit into
nextfrom
norbert/canary-branch-name-autorelease
Aug 14, 2025
Merged

Canary: Auto trigger canary release based on branch name ending#32258
ndelangen merged 1 commit into
nextfrom
norbert/canary-branch-name-autorelease

Conversation

@ndelangen
Copy link
Copy Markdown
Member

@ndelangen ndelangen commented Aug 13, 2025

Closes #

What I did

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

Greptile Summary

This PR automates the canary release process by modifying the .github/workflows/canary-release-pr.yml workflow to automatically trigger canary releases based on branch naming conventions. The key changes include:

  1. Automatic triggering: Added a pull_request trigger that responds to opened, synchronized, and reopened events, eliminating the need for manual workflow dispatch in many cases
  2. Branch name pattern matching: Changed from checking a hardcoded branch name (sb10/esm-only) to checking if any branch name ends with with-canary-release, making the system more flexible and scalable
  3. Conditional logic update: Modified the workflow condition to github.event_name == 'workflow_dispatch' || endsWith(github.head_ref, 'with-canary-release') to support both manual and automatic triggers
  4. Style improvements: Updated quote styles from double to single quotes throughout the workflow file

This change transforms the canary release workflow from a manual, single-branch system to an automated, pattern-based system. Contributors and maintainers can now trigger canary releases by simply naming their branches with the with-canary-release suffix, reducing manual overhead and providing a self-service mechanism for getting canary builds. The workflow maintains backward compatibility with manual triggers while adding the new automatic capability.

PR Description Notes:

  • The PR description is incomplete - the "What I did" section is empty and should describe the automation changes
  • No issue number is provided in the "Closes #" section
  • Testing and documentation checklists are not filled out

Confidence score: 2/5

  • This PR introduces significant security and resource concerns by allowing external contributors to trigger expensive canary releases automatically
  • Score reflects the potential for abuse and unintended resource consumption, plus possible authentication issues with the admin permission check
  • Pay close attention to the security implications of the new pull_request trigger and consider adding additional safeguards

@ndelangen ndelangen self-assigned this Aug 13, 2025
@ndelangen ndelangen added ci:docs Run the CI jobs for documentation checks only. build Internal-facing build tooling & test updates labels Aug 13, 2025
@ndelangen ndelangen requested a review from JReinhold August 13, 2025 14:12
@ndelangen ndelangen marked this pull request as ready for review August 13, 2025 14:12
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Aug 13, 2025

View your CI Pipeline Execution ↗ for commit a843a80

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 42s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-13 14:35:50 UTC

@ndelangen ndelangen merged commit da8cf20 into next Aug 14, 2025
13 of 18 checks passed
@ndelangen ndelangen deleted the norbert/canary-branch-name-autorelease branch August 14, 2025 07:34
@ndelangen ndelangen changed the title Build: Auto trigger canary release based on branch name Canary: Auto trigger canary release based on branch name ending Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:docs Run the CI jobs for documentation checks only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants