Skip to content

Commit

Permalink
Revert "feat: check for PR more explicitly (#35)"
Browse files Browse the repository at this point in the history
This reverts commit 65f6238.
  • Loading branch information
meeroslav committed Aug 9, 2022
1 parent 4f09e51 commit 619a6ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/scripts/find-successful-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { execSync } = require('child_process');
const https = require('https');

const buildUrl = process.argv[2];
const pullRequestUrl = process.argv[3];
const branchName = process.argv[3];
const mainBranchName = process.env.MAIN_BRANCH_NAME || process.argv[4];
const errorOnNoSuccessfulWorkflow = process.argv[5] === '1';
const allowOnHoldWorkflow = process.argv[6] === '1';
Expand All @@ -14,7 +14,7 @@ const [, host, project] = buildUrl.match(/https?:\/\/([^\/]+)\/(.*)\/\d+/);

let BASE_SHA;
(async () => {
if (pullRequestUrl) {
if (branchName !== mainBranchName) {
BASE_SHA = execSync(`git merge-base origin/${mainBranchName} HEAD`, { encoding: 'utf-8' });
} else {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/set-shas.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
echo "$PARAM_SCRIPT" >>"index.js"
RESPONSE=$(node index.js $CIRCLE_BUILD_URL $CIRCLE_PULL_REQUEST $PARAM_MAIN_BRANCH $PARAM_ERROR_ON_NO_SUCCESSFUL_WORKFLOW $PARAM_ALLOW_ON_HOLD $PARAM_WORKFLOW_NAME)
RESPONSE=$(node index.js $CIRCLE_BUILD_URL $CIRCLE_BRANCH $PARAM_MAIN_BRANCH $PARAM_ERROR_ON_NO_SUCCESSFUL_WORKFLOW $PARAM_ALLOW_ON_HOLD $PARAM_WORKFLOW_NAME)
echo "$RESPONSE"
BASE_SHA=$(echo "$RESPONSE" | grep 'Commit:' | sed 's/.*Commit: //')
HEAD_SHA=$(git rev-parse HEAD)
Expand Down

0 comments on commit 619a6ca

Please sign in to comment.