From b1b88f09a2776ff20a23048e71316df5d37b50cd Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 4 Dec 2021 07:31:37 -0500 Subject: [PATCH] Resolve error setting the base sha (#272) * Resolve error setting the base sha * Update action.yml * Update action.yml --- action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 7416b3a2..06629440 100644 --- a/action.yml +++ b/action.yml @@ -98,7 +98,9 @@ runs: # "Set base sha..." if [[ -n "${{ inputs.base_sha }}" ]]; then echo "::set-output name=base_sha::${{ inputs.base_sha }}" - elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event.base_ref }}" != "null" ]]; then + elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event_name }}" == "pull_request" ]]; then + echo "::set-output name=base_sha::${{ github.event.pull_request.base.sha }}" + elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event_name }}" == "push" && "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then echo "::set-output name=base_sha::${{ github.event.before }}" fi id: base-sha