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

Commit

Permalink
Make happo-ci-github-actions work on master
Browse files Browse the repository at this point in the history
We want the happo run to succeed, but make no comparisons.
  • Loading branch information
trotzig committed Jun 8, 2020
1 parent ecedbe5 commit 42624a1
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions happo-ci-github-actions
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@
# Make the whole script fail on errors
set -euo pipefail


cat $GITHUB_EVENT_PATH

# Prepare environment variables found in the github event json file.
ENV_VARS=$(echo "
const json = require('$GITHUB_EVENT_PATH');
if (!process.env.PREVIOUS_SHA) {
console.log(\`export PREVIOUS_SHA=\${json.pull_request.base.sha}\`);
if (json.pull_request) {
console.log(\`export PREVIOUS_SHA=\${json.pull_request.base.sha}\`);
} else {
console.log(\`export PREVIOUS_SHA=\${json.after}\`);
}
}
if (!process.env.CURRENT_SHA) {
console.log(\`export CURRENT_SHA=\${json.pull_request.head.sha}\`);
if (json.pull_request) {
console.log(\`export CURRENT_SHA=\${json.pull_request.head.sha}\`);
} else {
console.log(\`export CURRENT_SHA=\${json.after}\`);
}
}
if (!process.env.CHANGE_URL) {
if (!process.env.CHANGE_URL && json.pull_request) {
console.log(\`export CHANGE_URL=\${json.pull_request.html_url}\`);
}
" | node)
Expand Down

0 comments on commit 42624a1

Please sign in to comment.