Skip to content

Commit

Permalink
add assertion which checks for preview comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lukqw committed Dec 4, 2024
1 parent 697cbd5 commit fb37edc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ephemeral.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ jobs:
exit 1
fi
- name: Check PR Comments for preview text
id: check-comments
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
TEXT_TO_FIND="Preview for this PR"
# Fetch PR comments
comments=$(gh api repos/${{ github.repository }}/issues/$PR_NUMBER/comments)
# Check if the specific text is in the comments
if echo "$comments" | jq -e --arg text "$TEXT_TO_FIND" '.[] | select(.body | contains($text))' > /dev/null; then
echo "Found the text in PR comments."
else
echo "Text not found in PR comments."
exit 1
fi
# We want explicit shutdown
- name: Shutdown ephemeral instance
Expand Down

0 comments on commit fb37edc

Please sign in to comment.