From 42624a1b1ed5f8b509f40fe34244f74f86b6a487 Mon Sep 17 00:00:00 2001 From: Henric Trotzig Date: Mon, 8 Jun 2020 11:53:11 +0200 Subject: [PATCH] Make happo-ci-github-actions work on master We want the happo run to succeed, but make no comparisons. --- happo-ci-github-actions | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/happo-ci-github-actions b/happo-ci-github-actions index 506eb80..2d1f1e8 100755 --- a/happo-ci-github-actions +++ b/happo-ci-github-actions @@ -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)