Skip to content

Commit

Permalink
retrieve PR info
Browse files Browse the repository at this point in the history
  • Loading branch information
aldousalvarez committed Jun 12, 2024
1 parent cc2f9c5 commit ff060f1
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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 }}"

Check failure on line 22 in .github/workflows/pull-request.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

receiver of object dereference "body" must be type of object but got "string"

- 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

0 comments on commit ff060f1

Please sign in to comment.