Skip to content

[Internal] Use statuses instead of checks #61

[Internal] Use statuses instead of checks

[Internal] Use statuses instead of checks #61

name: Integration Tests
on:
pull_request:
branches: [ main ]
jobs:
check:
name: Run Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Delete old comments
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Delete previous comment if it exists
previous_comment_ids=$(gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
--jq '.[] | select(.body | startswith("<!-- INTEGRATION_TESTS -->")) | .id')
echo "Previous comment IDs: $previous_comment_ids"
# Iterate over each comment ID and delete the comment
if [ ! -z "$previous_comment_ids" ]; then
echo "$previous_comment_ids" | while read -r comment_id; do
echo "Deleting comment with ID: $comment_id"
gh api "repos/${{ github.repository }}/issues/comments/$comment_id" -X DELETE
done
fi
- name: Write new comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.pull_request.number }} --body \
"<!-- INTEGRATION_TESTS -->
Run integration tests using the corresponding workflow:
Inputs:
pull_request_number=${{github.event.pull_request.number}}
commit_sha=${{ github.event.pull_request.head.sha }}
This check will be approved automatically on success.
"