Skip to content

Commit 384c843

Browse files
authored
correct logic in github-actions-deps (#10818)
* correct logic in github-actions-deps ``` GITHUB_BASE_REF := $(shell echo "$${GITHUB_BASE_REF:-false}") ifneq ($(GITHUB_BASE_REF), false) ... ``` in the Makefile, this set the value of the Make var to `false` if no GITHUB_BASE_REF existed in environment Now we soley rely on [GitHub Actions env vars](https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables) since the Make variable doesn't propogate to the script. "The name of the base ref or target branch of the pull request in a workflow run. This is only set when the event that triggers a workflow run is either pull_request or pull_request_target. For example, main." So, on pushes to main this is empty. Thus our current condtion: ``` if [[ -z "${GITHUB_BASE_REF}" ]]; then ``` Is actually the opposite effect of what we had previously.debug * remove extraneous
1 parent 522927a commit 384c843

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
GITHUB_BASE_REF := $(shell echo "$${GITHUB_BASE_REF:-false}")
21
DB := example
32
IPYTHON := no
43

bin/github-actions-deps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export LANG="${ENCODING:-en_US.UTF-8}"
1010
# Print all the followng commands
1111
set -x
1212

13-
if [[ -z "${GITHUB_BASE_REF}" ]]; then
13+
if [[ ! -z "${GITHUB_BASE_REF}" ]]; then
1414
git fetch origin ${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF}
1515
# Check that the following diff will exit with 0 or 1
1616
git diff --name-only FETCH_HEAD || test $? -le 1 || exit 1

0 commit comments

Comments
 (0)