Skip to content

Adding Rootstock Integration Tests workflow #17

Adding Rootstock Integration Tests workflow

Adding Rootstock Integration Tests workflow #17

Workflow file for this run

name: Rootstock Integration Tests
on:
push:
branches:
- master
- '*-rc'
issue_comment:
types:
- created
- edited
pull_request:
types: [opened, reopened, synchronize]
branches:
- "**"
jobs:
fetch-pr-info:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up GitHub CLI
uses: cli/cli-action@v2
- name: Determine PR Number
id: get_pr_number
run: |
# Determine PR number based on the event
if [ -n "${{ github.event.pull_request.number }}" ]; then
PR_NUMBER="${{ github.event.pull_request.number }}"
elif [ -n "${{ github.event.issue.pull_request.url }}" ]; then
PR_URL="${{ github.event.issue.pull_request.url }}"
PR_NUMBER=$(echo "$PR_URL" | awk -F'/' '{print $NF}')
else
echo "No PR number found"
exit 1
fi
echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_ENV
- name: Fetch PR Details
run: |
echo "Fetching details for PR #${{ env.PR_NUMBER }}"
# Fetch PR details using GitHub CLI
gh pr view "${{ env.PR_NUMBER }}" --json title,body,number,comments,reviewRequests --jq '
.title as $title |
.body as $body |
.number as $number |
.comments.totalCount as $comments |
.reviewRequests.totalCount as $reviewRequests |
"Title: \($title)\nDescription: \($body)\nNumber: \($number)\nComments: \($comments)\nReview Requests: \($reviewRequests)"
'
# Fetch comments
echo "Fetching comments for PR #${{ env.PR_NUMBER }}"
gh pr view "${{ env.PR_NUMBER }}" --comments --jq '.[] | "\(.user.login): \(.body)"'