Skip to content

[Coding Guideline]: Do not compare raw pointers to allocations with different provenance #56

[Coding Guideline]: Do not compare raw pointers to allocations with different provenance

[Coding Guideline]: Do not compare raw pointers to allocations with different provenance #56

name: RST Preview Comment
on:
issues:
types: [opened, edited]
jobs:
post-rst-preview:
# Only run for issues created from the Coding Guideline template
# The template automatically adds the "coding guideline" label
if: contains(github.event.issue.labels.*.name, 'coding guideline')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install Pandoc
uses: pandoc/actions/setup@v1
- name: Generate RST preview comment
id: generate-comment
run: |
# Generate the comment content
COMMENT=$(cat <<'EOF' | uv run python scripts/generate-rst-comment.py
${{ toJson(github.event.issue) }}
EOF
)
# Write to file to preserve formatting
echo "$COMMENT" > /tmp/comment-body.md
# Find existing comment from this bot with the hidden marker
- name: Find existing RST preview comment
id: fc
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- rst-preview-comment -->'
# Create a new comment or update the existing one
- name: Create or update RST preview comment
uses: peter-evans/create-or-update-comment@v5
with:
issue-number: ${{ github.event.issue.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
body-path: /tmp/comment-body.md
edit-mode: replace