Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,24 @@ runs:
- name: Checkout PR Head
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
repository: ${{ inputs.repo_name }}
token: ${{ inputs.github_token }}
ref: refs/pull/${{ inputs.pull_number }}/head
fetch-depth: ${{ inputs.fetch_depth }}
path: pr

- name: Prepare Custom Context
id: custom_context
shell: bash
run: |
if [ -n "$CUSTOM_GUIDELINES" ]; then
echo 'context<<EOF' >> $GITHUB_OUTPUT
echo "$(jq -n --arg guidelines "$CUSTOM_GUIDELINES" '{custom_guidelines: $guidelines}')" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
echo 'context<<EOF' >> "$GITHUB_OUTPUT"
jq -n --arg guidelines "$CUSTOM_GUIDELINES" --arg repo "${{ inputs.repo_name }}" --arg pull_number "${{ inputs.pull_number }}" '{custom_guidelines: $guidelines, repo_name: $repo, pull_number: $pull_number}' >> "$GITHUB_OUTPUT"
echo 'EOF' >> "$GITHUB_OUTPUT"
else
echo "context={}" >> $GITHUB_OUTPUT
echo 'context<<EOF' >> "$GITHUB_OUTPUT"
jq -n --arg repo "${{ inputs.repo_name }}" --arg pull_number "${{ inputs.pull_number }}" '{repo_name: $repo, pull_number: $pull_number}' >> "$GITHUB_OUTPUT"
echo 'EOF' >> "$GITHUB_OUTPUT"
fi
env:
CUSTOM_GUIDELINES: ${{ inputs.custom_guidelines }}
Expand Down
3 changes: 3 additions & 0 deletions templates/guidelines/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- You are currently checked out on the head ref of this pull request.
- All changed files for the PR are in the context as CHANGED_FILES
- The full set of changes for the PR are in the context as DIFF
{% if custom.repo_name %}
- Explicitly set owner/repo to '{{ custom.repo_name }}' for GitHub operations
{% endif %}

### Comment Guidelines:
- **HIGH CONFIDENCE ONLY**: Only suggest changes you are highly confident will improve the code
Expand Down