File tree 1 file changed +5
-12
lines changed
1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -34,23 +34,16 @@ jobs:
34
34
TEMP_DIR="$(mktemp -d)"
35
35
# GITHUB_BASE_REF is set when the job is triggered by a PR.
36
36
TARGET_REF="${GITHUB_BASE_REF:-master}"
37
- # GITHUB_HEAD_REF is set when the job is triggered by a PR.
38
- SOURCE_REF="${GITHUB_HEAD_REF:-source}"
39
37
40
- # Replace special characters in the branch names.
41
- BEFORE_DIR_NAME="$(echo "${SOURCE_REF}" | sed 's/[^a-zA-Z0-9._-]/_/g')"
42
- AFTER_DIR_NAME="$(echo "${TARGET_REF}" | sed 's/[^a-zA-Z0-9._-]/_/g')"
43
-
44
-
45
- mkdir "${TEMP_DIR}/${AFTER_DIR_NAME}"
46
- scripts/gen-deps.sh "${TEMP_DIR}/${AFTER_DIR_NAME}"
38
+ mkdir "${TEMP_DIR}/after"
39
+ scripts/gen-deps.sh "${TEMP_DIR}/after"
47
40
48
41
git checkout "origin/${TARGET_REF}"
49
- mkdir "${TEMP_DIR}/${BEFORE_DIR_NAME} "
50
- scripts/gen-deps.sh "${TEMP_DIR}/${BEFORE_DIR_NAME} "
42
+ mkdir "${TEMP_DIR}/before "
43
+ scripts/gen-deps.sh "${TEMP_DIR}/before "
51
44
52
45
echo "Comparing dependencies..."
53
46
cd "${TEMP_DIR}"
54
47
# Run grep in a sub-shell since bash does not support ! in the middle of a pipe
55
- diff -u0 -r "./${BEFORE_DIR_NAME} " "./${AFTER_DIR_NAME} " | bash -c '! grep -v "@@"'
48
+ diff -u0 -r "before " "after " | bash -c '! grep -v "@@"'
56
49
echo "No changes detected."
You can’t perform that action at this time.
0 commit comments