Skip to content
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

ci: set changeset base remote #12499

Closed
wants to merge 2 commits into from
Closed

ci: set changeset base remote #12499

wants to merge 2 commits into from

Conversation

ascorbic
Copy link
Contributor

Changes

This should prevent the issues when reolving the base branch

Testing

Testing gh actions? lol

Docs

Copy link

changeset-bot bot commented Nov 22, 2024

⚠️ No Changeset found

Latest commit: b433e44

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.

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

@ascorbic
Copy link
Contributor Author

!preview changeset base

Copy link
Contributor

Invalid command. Expected: "/preview "

@ascorbic
Copy link
Contributor Author

!preview changeset-base

@bluwy
Copy link
Member

bluwy commented Nov 22, 2024

I believe the baseBranch field is only used to infer suggested changed packages when you run pnpm changeset, not related to publishing (if that's what you're trying to fix)

@github-actions github-actions bot added the 🚨 action Modifies GitHub Actions label Nov 22, 2024
@ascorbic
Copy link
Contributor Author

It was having trouble because next wasn't checked-out locally. This seemed to fix that, but is now complaining about being in pre mode, so I've added a line to exit it.

@bluwy
Copy link
Member

bluwy commented Nov 22, 2024

It was having trouble because next wasn't checked-out locally. This seemed to fix that

Basing on origin assumes that the remote is named origin I think, so it wouldn't work if some had a different remote name? e.g. from forks. I think I'd still leave it as next. I've also sent a fix in @changesets/cli recently that doesn't hard error if the baseBranch is not found though, but we haven't updated it yet.

About exiting pre, that seems fine to me 👍 We need to make sure that we remove it before merging next to main, or make it robust that it doesn't exit 1 if we're already out of pre mmode though.

@ascorbic
Copy link
Contributor Author

Ah great, I didn't realise you had a fix. I did the PR against main already, with || true #12502

@ascorbic ascorbic closed this Nov 22, 2024
@ascorbic ascorbic deleted the changeset-base branch November 22, 2024 11:04
@ascorbic
Copy link
Contributor Author

@bluwy
Copy link
Member

bluwy commented Nov 22, 2024

Maybe we need to update this line

- run: git fetch origin main:main

Copy link
Contributor

Invalid command. Expected: "/preview "

@ascorbic
Copy link
Contributor Author

Isn't that the same issue as setting baseBranch? Maybe we should combine changing the baseBranch with adding git remote set-url origin ... to set the origin to this repo

@bluwy
Copy link
Member

bluwy commented Nov 22, 2024

I don't think we should change the base branch with origin/ as it affects local development too. Maybe we can do that in CI only? Could use jq to set it. Or we can use jq to read it and then git fetch the right branch

@ascorbic
Copy link
Contributor Author

Yeah, or maybe get the base branch for the PR?

@bluwy
Copy link
Member

bluwy commented Nov 22, 2024

Could work too, but I'm not really sure what would happen if the base branch is a feature branch.

@ascorbic
Copy link
Contributor Author

So it looks ike the downside to exiting pre mode is that it publishes everything! https://github.com/withastro/astro/actions/runs/11971962174/job/33377860028

@bluwy
Copy link
Member

bluwy commented Nov 22, 2024

Yeah I don't think we could workaround that since that's kinda how changesets work. Previously even if we're not in pre mode, and the base branch had existing unrelated changesets, it also triggers releases from those changesets. So it's usually publishing more than it's needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 action Modifies GitHub Actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants