Skip to content

Commit ba07a72

Browse files
allow skipping a companion check
overcome the companion build system's shortcomings: #3 (comment)
1 parent 9f2e909 commit ba07a72

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

check_dependent_project.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,23 @@ main() {
229229

230230
while IFS= read -r line; do
231231
last_line="$line"
232-
if ! [[ "$line" =~ [cC]ompanion:[[:space:]]*([^[:space:]]+) ]]; then
233-
continue
234-
fi
235232

236-
echo "detected companion in PR description: ${BASH_REMATCH[1]}"
237-
process_companion_pr "${BASH_REMATCH[1]}"
233+
if [[ "$line" =~ [cC]ompanion:[[:space:]]*([^[:space:]]+) ]]; then
234+
echo "Detected companion in PR description: ${BASH_REMATCH[1]}"
235+
process_companion_pr "${BASH_REMATCH[1]}"
236+
elif [[ "$line" =~ skip[^[:alnum:]]+([^[:space:]]+) ]]; then
237+
# FIXME: This escape hatch should be removed at some point when the
238+
# companion build system is able to deal with all edge cases, such as
239+
# the one described in
240+
# https://github.com/paritytech/pipeline-scripts/issues/3#issuecomment-947539791
241+
if [[
242+
"${BASH_REMATCH[1]}" = "$CI_JOB_NAME" ||
243+
"${BASH_REMATCH[1]}" = "continuous-integration/gitlab-$CI_JOB_NAME"
244+
]]; then
245+
echo "Skipping $CI_JOB_NAME as specified in the PR description"
246+
exit
247+
fi
248+
fi
238249
done < <(curl \
239250
-sSL \
240251
-H "Authorization: token $GITHUB_TOKEN" \

0 commit comments

Comments
 (0)