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: preview release via pkg.pr.new for current packages #13218

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

ematipico
Copy link
Member

Changes

This PR revamps the pkg.pr.new that we had disabled.

Changes:

  • triggers the job only on labeled event
  • uses changeset status to retrieve the upcoming releases
  • uses a script to parse the JSON emitted by the previous step, and return a list of packages that have changesets. It returns a string
  • if the previous string is empty, we write a message in the PR saying that no preview release was published
  • if the previous string isn't empty, it's passed to the pkg pr new CLI

Testing

I tested the script locally.
This PR needs to be merged, I will enable the job again, and then open a PR to test it.

Docs

N/A

Copy link

changeset-bot bot commented Feb 11, 2025

⚠️ No Changeset found

Latest commit: 4dc1024

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

@github-actions github-actions bot added the 🚨 action Modifies GitHub Actions label Feb 11, 2025
Copy link
Contributor

❌ Snapshot release failed.

@ematipico ematipico force-pushed the ci/preview-releases-revamp branch from 51b509c to 07a5dd0 Compare February 11, 2025 15:29
@ematipico ematipico requested a review from ascorbic February 11, 2025 15:49
run: pnpm changeset status --output=changesets.json

- name: Retrieve packages to publish
uses: actions/github-script@v7
Copy link
Contributor

Choose a reason for hiding this comment

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

You could probably do this without the script using jq on the command line, but it's not a big deal. (I always ask an LLM for the actual arguments because I can never remember the syntax)

Copy link
Member Author

Choose a reason for hiding this comment

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

I evaluated jq, but for a project like Astro, having a JS script might be better for contributions and bug fixes

@ematipico ematipico merged commit f9d7769 into main Feb 11, 2025
2 checks passed
@ematipico ematipico deleted the ci/preview-releases-revamp branch February 11, 2025 15:55
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