Skip to content

move-decls (comment) #5974

move-decls (comment)

move-decls (comment) #5974

name: move-decls (comment)
on:
issue_comment:
types: [created, edited]
pull_request_review_comment:
types: [created, edited]
jobs:
move-decls-add-comment:
if: contains(github.event.comment.body, 'move-decls') || ((github.event.issue.pull_request != 'null') && (startsWith(github.event.comment.body, 'move-decls') || contains(toJSON(github.event.comment.body), '\r\nmove-decls')))
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
## fetch the whole repository, useful to find a common fork
fetch-depth: 0
- id: short_diff
run: |
## back and forth to settle a "detached head" (maybe?)
git checkout -q master
git checkout -q -
printf $'summary<<EOF\n%s\nEOF' "$(./scripts/no_lost_declarations.sh short)" >> "$GITHUB_OUTPUT"
- name: Add comment
run: gh pr comment "$NUMBER" --body "$BODY"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
BODY: ${{ steps.short_diff.outputs.summary }}