Adding Rootstock Integration Tests workflow #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Install GitHub CLI | |
run: | | |
sudo apt-get update | |
sudo apt-get install gh | |
- name: Determine PR Number | |
id: get_pr_number | |
run: | | |
# Debug output | |
echo "GitHub event type: ${{ github.event_name }}" | |
# 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)"' |