Skip to content

Commit

Permalink
Don't require providing owner and repo names
Browse files Browse the repository at this point in the history
Instead, get this from BUILDKITE env variable. I took this idea from comment_on_pr script.
  • Loading branch information
wzieba committed Sep 16, 2024
1 parent c13194f commit a907fe1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/comment_with_dependency_diff
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ set -euo pipefail

MODULE="${1:-}"
CONFIGURATION="${2:-}"
OWNER="${3:-}"
REPO="${4:-}"

if [ -z "$MODULE" ] || [ -z "$CONFIGURATION" ] || [ -z "$OWNER" ] || [ -z "$REPO" ]; then
echo "Not enough arguments provided. Usage: ./comment_with_dependency_diff <MODULE> <CONFIGURATION> <OWNER> <REPO>"
if [ -z "$MODULE" ] || [ -z "$CONFIGURATION" ]; then
echo "Not enough arguments provided. Usage: ./comment_with_dependency_diff <MODULE> <CONFIGURATION>"
exit 1
fi

OWNER=$(basename "$(dirname "${BUILDKITE_PULL_REQUEST_REPO}")")
REPO=$(basename "${BUILDKITE_PULL_REQUEST_REPO%.git}")

DIFF_DEPENDENCIES_FOLDER="./build/reports/diff"
BASE_BRANCH_DEPENDENCIES_FILE="$DIFF_DEPENDENCIES_FOLDER/base_branch_dependencies.txt"
HEAD_BRANCH_DEPENDENCIES_FILE="$DIFF_DEPENDENCIES_FOLDER/head_branch_dependencies.txt"
Expand Down

0 comments on commit a907fe1

Please sign in to comment.