Skip to content

CR From a PR

CR From a PR #12

Workflow file for this run

# Name the workflow
name: Code Review
# on: [workflow_dispatch]
on:
pull_request:
types: [opened, reopened]
jobs:
# -------------------------------------------------------------
# Event `pull_request`: Returns all changed pull request files.
# --------------------------------------------------------------
changed_files:
# NOTE:
# - This is limited to pull_request* events and would raise an error for other events.
# - A maximum of 3000 files can be returned.
# - For more flexibility and no limitations see "Using local .git history" above.
runs-on: ubuntu-latest # windows-latest || macos-latest
name: Run Code Review
permissions:
pull-requests: read
steps:
- name: Get diff
id: diff
uses: actions/github-script@v6
with:
script: |
const diff_url = context.payload.pull_request.diff_url
const result = await github.request(diff_url)
console.log(result)
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
# Run the code review
- name: Start code review step
id: code_review
uses: aronweiler/codereviewer@main
env:
CHANGES: ${{ steps.changed-files.outputs.all_changed_files }}
# Use the output from the code_review step
- name: Get the summary
run: echo "Summary- ${{ steps.code_review.outputs.summary }}"