Skip to content

Work around transitive companions #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions check_dependent_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,23 @@ main() {

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

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