stefanvodita commented on code in PR #14279: URL: https://github.com/apache/lucene/pull/14279#discussion_r1966913749
########## .github/workflows/verify-changelog-and-set-milestone.yml: ########## @@ -0,0 +1,100 @@ +name: "Change Log Entry Verifier and Milestone Setter" +run-name: Change log entry verifier and milestone setter +on: + - pull_request_target + +env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE: ${{ github.event.issue.html_url }} + ESCAPE_HATCH: ${{ '__NA__' }} + CHANGE_LOG_FILE: ${{ 'lucene/CHANGES.txt' }} + +jobs: + changelog-verifier-and-milestone-setter: + name: Verify Change Log Entry and Set Milestone + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: ChangeLog Entry Verifier and Milestone Setter + run: | + echo "################## STEP 1 ##################" + echo "Checking for escape hatch in the top comment" + pr_comment=$(gh pr view ${{ github.event.number }} --json body -q '.body') + if echo "$pr_comment" | grep -q ${{ env.ESCAPE_HATCH }}; then + echo "Skipping checks as escape hatch: ${ESCAPE_HATCH} is found in the top comment." + exit 0 + else + echo "No escape hatch found in the top comment. Proceeding with next steps." + fi + + + echo -e "\n" + echo "################## STEP 2 ##################" + echo "Checking for change log entry in ${{ env.CHANGE_LOG_FILE }}" + git log --pretty=oneline | tail -n 2 | cat + echo "merge base sha: ${{ github.event.pull_request.base.sha }}, merge head sha: ${{ github.event.pull_request.head.sha }}" + if ! git diff ${{ github.event.pull_request.base.sha }} --name-only | grep -q "${{ env.CHANGE_LOG_FILE }}"; then + echo "Change log file:${{ env.CHANGE_LOG_FILE }} does not contains an entry corresponding to changes introduced in PR. Please add a changelog entry." Review Comment: It's good for this to be in the log now, but could we make it a PR comment eventually? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org