Skip to content

Commit

Permalink
Check for readme_filepath label not being present
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Nov 20, 2023
1 parent 97f3124 commit f704ae2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ jobs:
if: github.event_name != 'pull_request'
id: image_readme_filepath
run: |
readme_filepath=$(docker buildx bake --print 2>/dev/null | jq -r '.target.default.labels["dev.polymathrobotics.image.readme-filepath"]')
if [[ -n "$readme_filepath" ]]; then
json_data="$(docker buildx bake local --print 2>/dev/null)"
# Check if .group.local.targets.default exists, and if it does, extract its value
exit_code=0
result=$(echo "$json_data" | jq -e '.target.default.labels["dev.polymathrobotics.image.readme-filepath"]') || exit_code=$?
if [ $exit_code -eq 0 ]; then
readme_filepath=$(echo $json_data | jq -r '.target.default.labels["dev.polymathrobotics.image.readme-filepath"]')
echo "image_readme_filepath=$readme_filepath" >> $GITHUB_ENV
else
echo "image_readme_filepath=${{ matrix.image }}/README.md" >> $GITHUB_ENV
Expand Down

0 comments on commit f704ae2

Please sign in to comment.