Skip to content
Snippets Groups Projects
Unverified Commit 9e92743d authored by Ariya Hidayat's avatar Ariya Hidayat Committed by GitHub
Browse files

CI with GitHub Actions: make some jobs conditional on the context (#18425)

parent abc55941
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,12 @@ jobs:
const pullRequestNumbers = Array.from(commitMessage.matchAll(/\(#(.*?)\)/g))
if (pullRequestNumbers.length === 0) {
return;
return {
author: "",
pullRequestNumber: 0,
title: "",
hasBackportLabel: false
};
}
if (pullRequestNumbers > 1) {
......@@ -74,7 +79,7 @@ jobs:
};
const latestReleaseBranch = releaseBranches.data
.filter(branch => getVersionFromBranch(branch.ref) !== null)
.reduce((prev, current) => getVersionFromBranch(prev.ref) > getVersionFromBranch(current.ref) ? prev : current);
.reduce((prev, current) => getVersionFromBranch(prev.ref) > getVersionFromBranch(current.ref) ? prev : current, { ref: "" });
const latestReleaseBranchName = latestReleaseBranch.ref.replace(/^refs\/heads\//, "");
console.log(`Latest release branch: ${latestReleaseBranchName}`)
......
......@@ -115,3 +115,4 @@ jobs:
run: yarn run test-visual-no-build
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
if: env.PERCY_TOKEN != null
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment