Skip to content
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

Minor CI lint/notice steps improvement #3089

Merged
merged 10 commits into from
Jan 9, 2025
1 change: 1 addition & 0 deletions .buildkite/run_linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if is_pr; then
echo "Nothing to be fixed by autoformat"
exit 0
else
git --no-pager diff
echo "linting errors are fixed, pushing the diff"
export GH_TOKEN="$VAULT_GITHUB_TOKEN"

Expand Down
1 change: 1 addition & 0 deletions .buildkite/run_notice_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ make notice
if [ -z "$(git status --porcelain | grep NOTICE.txt)" ]; then
exit 0
else
git --no-pager diff
if is_pr; then
export GH_TOKEN="$VAULT_GITHUB_TOKEN"

Expand Down
28 changes: 5 additions & 23 deletions .buildkite/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,9 @@ retry() {
}

is_pr() {
[[ "${BUILDKITE_PULL_REQUEST-}" ]] && return
false
}

retry() {
local retries=$1; shift
local delay=$1; shift
local attempts=1

until "$@"; do
retry_exit_status=$?
echo "Exited with $retry_exit_status" >&2
if (( retries == "0" )); then
return $retry_exit_status
elif (( attempts == retries )); then
echo "Failed $attempts retries" >&2
return $retry_exit_status
else
echo "Retrying $((retries - attempts)) more times..." >&2
attempts=$((attempts + 1))
sleep "$delay"
fi
done
if [ -z "$BUILDKITE_PULL_REQUEST" ] || [ "$BUILDKITE_PULL_REQUEST" = "false"]; then
return 1 # false
else
return 0 # true
fi
}
Loading