Skip to content

retrieve PR info

retrieve PR info #1

Workflow file for this run

name: Retrieve PR Info
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
retrieve-pr-info:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get PR description
id: get_pr_description
uses: octokit/[email protected]
with:
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Output PR description
run: echo "PR Description = ${{ steps.get_pr_description.outputs.data.body }}"
- name: Get PR commits
id: get_pr_commits
uses: octokit/[email protected]
with:
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits
token: ${{ secrets.GITHUB_TOKEN }}
- name: Output PR commit messages
run: |
echo "PR Commit Messages:"
for commit in $(echo '${{ steps.get_pr_commits.outputs.data }}' | jq -r '.[].commit.message'); do
echo "- $commit"
done