Skip to content
Closed
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
23 changes: 23 additions & 0 deletions .github/workflows/comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Auto Comment on PR

on:
pull_request:

jobs:
auto-comment:
runs-on: ubuntu-latest
steps:
- name: Check PR Changes
id: pr-changes
run: echo "::set-output name=changes::${{ toJson(github.event.pull_request.changed_files) }}"

- name: Create Comment
if: steps.pr-changes.outputs.changes != '[]'
run: |
# Use GitHub API to create a comment on the PR
PR_NUMBER=${{ github.event.pull_request.number }}
COMMENT="# Checklist before merging\n\n- [ ] Add description to the Pull Request\n- [ ] Check the License of new pictures (non-commercial use without attribution)\n- [ ] Modify content in English\n- [ ] Modify content in German\n- [ ] Modify content in French"
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"

curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"
Loading