diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index ac770335a4e0..e88cde7de48c 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -30,12 +30,18 @@ jobs: # Run the commands to generate dependencies before and after and compare. - name: Compare dependencies run: | - BEFORE="$(mktemp -d)" - AFTER="$(mktemp -d)" + set -eux + BASE_REF="${GITHUB_BASE_REF:-master}" + # Suffixes passed to mktemp must not contain "/". + BEFORE_SUFFIX="${BASE_REF//\//_}" + AFTER_SUFFIX="${GITHUB_REF_NAME//\//_}" + + BEFORE="$(mktemp -d --suffix="-${BEFORE_SUFFIX}")" + AFTER="$(mktemp -d --suffix="-${AFTER_SUFFIX}")" scripts/gen-deps.sh "${AFTER}" # GITHUB_BASE_REF is set when the job is triggered by a PR. - git checkout origin/"${GITHUB_BASE_REF:-master}" + git checkout origin/"${BASE_REF}" scripts/gen-deps.sh "${BEFORE}" echo "Comparing dependencies..."