Skip to content

Commit 9e92743

Browse files
author
Ariya Hidayat
authored
CI with GitHub Actions: make some jobs conditional on the context (metabase#18425)
1 parent abc5594 commit 9e92743

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/auto-backport.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ jobs:
2424
const pullRequestNumbers = Array.from(commitMessage.matchAll(/\(#(.*?)\)/g))
2525
2626
if (pullRequestNumbers.length === 0) {
27-
return;
27+
return {
28+
author: "",
29+
pullRequestNumber: 0,
30+
title: "",
31+
hasBackportLabel: false
32+
};
2833
}
2934
3035
if (pullRequestNumbers > 1) {
@@ -74,7 +79,7 @@ jobs:
7479
};
7580
const latestReleaseBranch = releaseBranches.data
7681
.filter(branch => getVersionFromBranch(branch.ref) !== null)
77-
.reduce((prev, current) => getVersionFromBranch(prev.ref) > getVersionFromBranch(current.ref) ? prev : current);
82+
.reduce((prev, current) => getVersionFromBranch(prev.ref) > getVersionFromBranch(current.ref) ? prev : current, { ref: "" });
7883
const latestReleaseBranchName = latestReleaseBranch.ref.replace(/^refs\/heads\//, "");
7984
8085
console.log(`Latest release branch: ${latestReleaseBranchName}`)

.github/workflows/percy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,4 @@ jobs:
115115
run: yarn run test-visual-no-build
116116
env:
117117
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
118+
if: env.PERCY_TOKEN != null

0 commit comments

Comments
 (0)