Skip to content

Commit

Permalink
Only output json var if non-empty
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Dec 3, 2023
1 parent 4dd07af commit 135f5a4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,22 @@ jobs:
done
)
# Clip extra comma and send to output
# Clip any trailing commas
JSON=$(echo [$LIST] | sed 's/\(.*\),/\1/')
# Send to output if non-empty
echo "json=${JSON}"
echo "json=${JSON}" >> $GITHUB_OUTPUT
if ["${json}" != "[]"]
then
echo "json=${JSON}" >> $GITHUB_OUTPUT
fi
# https://github.com/bcgov-nr/action-builder-ghcr
builds:
name: Builds
needs: [scrub]
if: "!github.event.pull_request.head.repo.fork"
# if: "!github.event.pull_request.head.repo.fork"
if: ${{ needs.scrub.outputs.json }}
permissions:
packages: write
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 135f5a4

Please sign in to comment.