Skip to content

Commit

Permalink
ci: Handle empty log-url when commenting on PRs (#1851)
Browse files Browse the repository at this point in the history
Extracted from #1847
  • Loading branch information
larseggert authored Apr 23, 2024
1 parent 4fc4d16 commit e53d60f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/actions/pr-comment-data-export/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ runs:
mkdir comment-data
cp "${{ inputs.contents }}" comment-data/contents
echo "${{ inputs.name }}" > comment-data/name
echo "${{ inputs.log-url }}" > comment-data/log-url
echo "${{ github.event.number }}" > comment-data/pr-number
if [ -n "${{ inputs.log-url }}" ]; then
echo "${{ inputs.log-url }}" > comment-data/log-url
fi
- if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/pr-comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ runs:

- shell: bash
run: |
[ -s log-url ] && echo "" >> contents && echo "[:arrow_down: Download logs]($(cat log-url))" >> contents
if [ -s log-url ]; then
echo "" >> contents
echo "[:arrow_down: Download logs]($(cat log-url))" >> contents
fi
- uses: thollander/actions-comment-pull-request@v2
with:
Expand Down

0 comments on commit e53d60f

Please sign in to comment.