Skip to content

Commit

Permalink
πŸ— Read merge commit only if file was created (#33264)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha committed Mar 15, 2021
1 parent 60adca7 commit fb7f095
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .circleci/fetch_merge_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ if [[ -z "$PR_NUMBER" ]]; then
exit 0
fi

# If PR_NUMBER exists, but the merge commit file doesn't exist, the PR was
# created after the first stage of CI was run. There is nothing more to do.
if [[ ! -f .CIRCLECI_MERGE_COMMIT ]]; then
exit 0
fi

# Extract the merge commit for this workflow and make it visible to other steps.
CIRCLECI_MERGE_COMMIT="$(cat .CIRCLECI_MERGE_COMMIT)"
echo "export CIRCLECI_MERGE_COMMIT=$CIRCLECI_MERGE_COMMIT" >> $BASH_ENV
Expand Down

0 comments on commit fb7f095

Please sign in to comment.