From 2dda278f6c2a128a3016c45e0d9e313639b06562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJamesHenry=E2=80=9D?= Date: Thu, 20 Jun 2024 19:10:26 +0400 Subject: [PATCH] chore(repo): allow e2e workflows to publish relative versions --- .github/workflows/e2e-matrix.yml | 1 + .github/workflows/e2e-windows.yml | 1 + scripts/nx-release.ts | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-matrix.yml b/.github/workflows/e2e-matrix.yml index 09c1137a66e8d3..89141c744d7694 100644 --- a/.github/workflows/e2e-matrix.yml +++ b/.github/workflows/e2e-matrix.yml @@ -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() }} diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml index 2351c2988cd78e..92771606ff9550 100644 --- a/.github/workflows/e2e-windows.yml +++ b/.github/workflows/e2e-windows.yml @@ -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() }} diff --git a/scripts/nx-release.ts b/scripts/nx-release.ts index 2556d7f7c6c87a..b8821a91bd9d51 100755 --- a/scripts/nx-release.ts +++ b/scripts/nx-release.ts @@ -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.'