-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
chore(repo): refactor publish.yml for PR releases #26550
Conversation
Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
module.exports = async ({ github, context, core }) => { | ||
const data = await getPublishResolveData({ github, context }); | ||
|
||
// Ensure that certain outputs are always set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added checks for missing data
* | ||
* Source: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables | ||
*/ | ||
const refName = process.env.GITHUB_REF_NAME; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored to use the env var now that we know the JS copy of github
does not match the GitHub Actions shell one, and explicitly checking for it not being set. I believe it should be able for all triggers, but we can relax this if it is not because we will be covered by the check above before setting the outputs
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 64354d0. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
@@ -241,7 +239,16 @@ function parseArgs() { | |||
description: | |||
'The version to publish. This does not need to be passed and can be inferred.', | |||
default: 'minor', | |||
coerce: (version) => { | |||
coerce: (version: string) => { | |||
const isGithubActions = !!process.env.GITHUB_ACTIONS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added extra safety check for the combination that bit us yesterday - if in the context of GitHub Actions we should always be receiving an explicit version number, not a relative keyword (our default of minor
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is the same as yesterday's merge
Redo of #26509, with more guards for unexpected missing/relative values within full releases in GitHub Actions. --- Refactors our publish workflow to support PR releases, in addition to our previous triggers. **Tests:** --- - Example of failure on non-PR release (comment skipped): https://github.com/nrwl/nx/actions/runs/9480869812 --- - Example of failure on PR release (comment created on PR): - https://github.com/nrwl/nx/actions/runs/9480852880 - #26515 (comment) --- - Example of dry-run of full release (`workflow_dispatch` with no PR number provided): https://github.com/nrwl/nx/actions/runs/9497871483 --- - Real PR release created here: | Release details | 📑 | | ------------- | ------------- | | **Published version** | [0.0.0-pr-26515-856ef7f](https://www.npmjs.com/package/nx/v/0.0.0-pr-26515-856ef7f) | | **Triggered by** | @JamesHenry | | **Branch** | [JamesHenry-patch-1](https://github.com/nrwl/nx/tree/JamesHenry-patch-1) | | **Commit** | [856ef7f](856ef7f) | | **Workflow run** | [9497298216](https://github.com/nrwl/nx/actions/runs/9497298216) | --------- Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com> (cherry picked from commit 42749b8)
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Redo of #26509, with more guards for unexpected missing/relative values within full releases in GitHub Actions.
Refactors our publish workflow to support PR releases, in addition to our previous triggers.
Tests:
workflow_dispatch
with no PR number provided): https://github.com/nrwl/nx/actions/runs/9497871483