retrieve PR info #1
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: 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 |