Skip to content

Commit

Permalink
test write back
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirianni committed Jan 22, 2024
1 parent 00e4c3f commit 8366507
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ CONFIG_PATH=$6
OUTPUT_PATH=$7
OUTPUT_BRANCH=$8

BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})
echo "Current branch is $BRANCH_NAME"

install_bindplane_cli() {
curl -Ls \
-o bindplane.zip \
Expand Down Expand Up @@ -55,6 +58,16 @@ validate() {
}

write_back() {
# If output branch matches current branch, write back to repo
if [ "$BRANCH_NAME" == "$OUTPUT_BRANCH" ]; then
echo "Writing back to repo"
# TODO, move logic here
else
echo "Skipping repo write. Current branch ${BRANCH_NAME} does not match output branch ${OUTPUT_BRANCH}."
fi

# TODO handle output path dir checks

mkdir tmp
for config in $(bindplane get config | awk 'NR>1 {print $1}'); do
bindplane get config "$config" -o raw > "tmp/$config.yaml"
Expand Down

0 comments on commit 8366507

Please sign in to comment.