Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

Commit 42624a1

Browse files
committed
Make happo-ci-github-actions work on master
We want the happo run to succeed, but make no comparisons.
1 parent ecedbe5 commit 42624a1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

happo-ci-github-actions

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,27 @@
33
# Make the whole script fail on errors
44
set -euo pipefail
55

6+
7+
cat $GITHUB_EVENT_PATH
8+
69
# Prepare environment variables found in the github event json file.
710
ENV_VARS=$(echo "
811
const json = require('$GITHUB_EVENT_PATH');
912
if (!process.env.PREVIOUS_SHA) {
10-
console.log(\`export PREVIOUS_SHA=\${json.pull_request.base.sha}\`);
13+
if (json.pull_request) {
14+
console.log(\`export PREVIOUS_SHA=\${json.pull_request.base.sha}\`);
15+
} else {
16+
console.log(\`export PREVIOUS_SHA=\${json.after}\`);
17+
}
1118
}
1219
if (!process.env.CURRENT_SHA) {
13-
console.log(\`export CURRENT_SHA=\${json.pull_request.head.sha}\`);
20+
if (json.pull_request) {
21+
console.log(\`export CURRENT_SHA=\${json.pull_request.head.sha}\`);
22+
} else {
23+
console.log(\`export CURRENT_SHA=\${json.after}\`);
24+
}
1425
}
15-
if (!process.env.CHANGE_URL) {
26+
if (!process.env.CHANGE_URL && json.pull_request) {
1627
console.log(\`export CHANGE_URL=\${json.pull_request.html_url}\`);
1728
}
1829
" | node)

0 commit comments

Comments
 (0)