Skip to content

Commit

Permalink
chore(repo): allow e2e workflows to publish relative versions
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Jun 20, 2024
1 parent bb3658a commit 2dda278
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/e2e-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ jobs:
NX_PERF_LOGGING: 'false'
NX_DAEMON: 'true'
NX_SKIP_LOG_GROUPING: 'true'
NX_GITHUB_E2E_WORKFLOW: 'true'

- name: Save matrix config in file
if: ${{ always() }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ jobs:
NX_PERF_LOGGING: 'false'
NX_DAEMON: 'true'
NX_SKIP_LOG_GROUPING: 'true'
NX_GITHUB_E2E_WORKFLOW: 'true'

- name: Save matrix config in file
if: ${{ always() }}
Expand Down
8 changes: 7 additions & 1 deletion scripts/nx-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,13 @@ function parseArgs() {
default: 'minor',
coerce: (version: string) => {
const isGithubActions = !!process.env.GITHUB_ACTIONS;
if (isGithubActions && isRelativeVersionKeyword(version)) {
// Make an exception for our automated e2e workflows
const isGithubActionsE2EWorkflow = !!process.env.NX_GITHUB_E2E_WORKFLOW;
if (
isGithubActions &&
!isGithubActionsE2EWorkflow &&
isRelativeVersionKeyword(version)
) {
// Print error rather than throw to avoid yargs noise in this specifically handled case
console.error(
'Error: The release script was triggered in a GitHub Actions workflow, but a relative version keyword was provided. This is an unexpected combination.'
Expand Down

0 comments on commit 2dda278

Please sign in to comment.