From 0ba308247a1603bc188794f2445ba3b9f2f465d7 Mon Sep 17 00:00:00 2001 From: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:48:58 +0100 Subject: [PATCH] [testing workflows] Add pre-release checks (#50204) --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7e4bfad4f8..0e878256389 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,8 @@ jobs: // Intended behaviour of the jobs generation: // - PRs: run CI jobs aiming PRs and filter out jobs based on the content changes // - Pushes: run CI jobs aiming pushes without filtering based on the content changes + + // github.base_ref is only available for pull_request events let baseRef = ${{ toJson( github.base_ref ) }}; if ( baseRef ) { baseRef = `--base-ref origin/${ baseRef }`; @@ -74,6 +76,12 @@ jobs: githubEvent = trigger; } + // `pre-release` should trigger `release-checks`, but without a 'tag' ref. + // This will run all release-checks against the branch the workflow targeted, instead of a release artifact. + if ( trigger === 'pre-release' ) { + githubEvent = 'release-checks'; + } + const child_process = require( 'node:child_process' ); child_process.execSync( `pnpm utils ci-jobs ${ baseRef } --event ${ githubEvent }` );