Skip to content

chore: don't require approval on scheduled canary releases - #2148

Open
davidkna-sap wants to merge 2 commits into
mainfrom
davidkna-sap/env-protection-v2
Open

chore: don't require approval on scheduled canary releases#2148
davidkna-sap wants to merge 2 commits into
mainfrom
davidkna-sap/env-protection-v2

Conversation

@davidkna-sap

Copy link
Copy Markdown
Member

Context

Closes SAP/ai-sdk-js-backlog#ISSUENUMBER.

This ensure scheduled event do not require approval.

What this PR does and why it is needed

@hyperspace-pr-bot

hyperspace-pr-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Context

What this PR does and why it is needed

This PR updates the publish.yml GitHub Actions workflow to allow scheduled canary releases to proceed without requiring manual approval, while still enforcing approval for releases triggered by a GitHub Release event.

Key changes:

  • Adds an approval job that conditionally uses either the ensure-main environment (for scheduled runs, no approval gate) or the approve-release environment (for GitHub Release events, requires approval).
  • Adds an ensure-main job that only runs on GitHub Release events to verify the release is on the main branch.
  • Updates delegate_to_release_job to depend on both approval and ensure-main.
  • Updates delegate_to_canary_job to depend on approval, enabling scheduled canary releases to skip the approval gate automatically.

This ensures that nightly scheduled canary builds are fully automated without blocking on a manual approval step, while official releases still require explicit sign-off.

Category: 🔧 Chore


  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.29.18

  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: 40b77540-9560-11f1-8479-6f67f1f1dacc
  • File Content Strategy: Full file content
  • Summary Prompt: Default Prompt
  • Output Template: Repository PR Template
  • Event Trigger: issue_comment.edited

@davidkna-sap
davidkna-sap requested a review from marikaner August 11, 2026 08:35
name: Approve Release
runs-on: ubuntu-latest
# Scheduled releases may continue without approval, but releases triggered by a GitHub Release require approval.
environment: ${{ case(github.event_name == 'schedule', 'ensure-main', 'approve-release') }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am making this conditional here, because otherwise delegate_to_canary_job will need a more complicated if expression.

@marikaner marikaner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a benefit to adding these additional environments and enforcing them here?
Why don't we just split the release environment into two?

release:

  • needs approval, runs on main, registered on npm

canary-release:

  • registered on npm

Also:

  • The current ensure-main environment only ensures that this runs on a protected branch, not necessarily main.
  • I think it would be nice to allow publishing canary versions from a different branch than main, this is helpful if you need to try something out before merging it.

@davidkna-sap

Copy link
Copy Markdown
Member Author

@marikaner We can only register one environment on npm afaik.

The way this should work now:

  • Scheduled release: no approval, needs to run on main/protected branch.
  • Regular release: approval, needs to run on main/protected branch.
  • Manual canary release: approval, no branch restrictions.

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.

2 participants