Skip to content

Protect publishes with env gate#610

Merged
Andarist merged 7 commits intomainfrom
env-gate
May 7, 2026
Merged

Protect publishes with env gate#610
Andarist merged 7 commits intomainfrom
env-gate

Conversation

@Andarist
Copy link
Copy Markdown
Member

@Andarist Andarist commented May 6, 2026

No description provided.

@Andarist Andarist requested a review from emmatown as a code owner May 6, 2026 09:24
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

⚠️ No Changeset found

Latest commit: 5c49ca6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

I don't see how this meaningfully protects anything, since "publishing" in this context means pushing to a branch/tag/whatever. I suspect if we want to do any sort of protecting things, it would involve branch protections. Like CODEOWNERS here does nothing, CODEOWNERS + branch protection restricting by CODEOWNERS can certainly do something but i don't think this does. I think the solution might involve the release script creating another PR to the branch with the built version after merging in the Version packages which would be akin to the environment approval and the merge would require approval or something by myself/you/whoever because of a branch protection on the release. (probably use the newer iteration of branch protections "Rulesets" to do it)

For preview "releasing" PRs, maybe we want a job which would run the build and then push to branch like maybe ${branchName}-built or something but for forks, it would do that on the forked repo, not this repo. Maybe this is just a workflow dispatch which accepts what branch it should "release" and a contributor could run it on their fork if they want?

@Andarist
Copy link
Copy Markdown
Member Author

Andarist commented May 7, 2026

I think the current improved setup with branch+tag ruleset protections, required env approvals and bot having bypass on those protections works quite OK and doesn't require complicating the workflow further. WDYT?

As to preview releasing, we could use a workflow dispatch, sure. I feel the comment is slightly nicer as it doesn't require switching tabs and stuff and creates a nice "log" of trigger->failure/success messages in the comments. This is also something that is going to be rarely used by us really and ultimately, I don't think it requires extra protections as this is only a preview channel and not a prod one (and only collaborators can trigger those previews too)

Comment thread .github/CODEOWNERS
Comment on lines -1 to +5
* @Andarist @emmatown
/.github/workflows/** @Andarist @emmatown
/action.yml @Andarist @emmatown
/scripts/bump.ts @Andarist @emmatown
/scripts/release.ts @Andarist @emmatown
/scripts/release-pr.ts @Andarist @emmatown
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure what value the CODEOWNERS has?

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.

Not a lot really - it's just an extra precaution so we are always required to review those particular changes


- name: Create or update release pull request
id: changesets
uses: ./
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

huh, that's fun

Comment thread .github/workflows/release-pr.yml Outdated
Comment thread .github/workflows/publish.yml Outdated
emmatown
emmatown previously approved these changes May 7, 2026
Copy link
Copy Markdown
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

Just want to note that from reading the changes, I expect that the release PR workflow wouldn't work on PRs from forks now but otherwise, looks good

@Andarist Andarist added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 91b9111 May 7, 2026
5 checks passed
@Andarist Andarist deleted the env-gate branch May 7, 2026 09:17
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