mirror of
https://github.com/github/codeql-action.git
synced 2026-10-29 09:07:12 +00:00
Add CHANGELOG.md modification check and warning comment
This commit is contained in:
25
.github/workflows/pr-checks.yml
vendored
25
.github/workflows/pr-checks.yml
vendored
@@ -181,6 +181,31 @@ jobs:
|
||||
path: ${{ runner.temp }}/repo-size/
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Check for CHANGELOG.md changes
|
||||
id: changelog-check
|
||||
if: steps.fetch-base.outcome == 'success'
|
||||
env:
|
||||
BASE_SHA: ${{ steps.fetch-base.outputs.merge_base }}
|
||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: |
|
||||
if ! git diff --exit-code --quiet "$BASE_SHA" "$HEAD_SHA" -- CHANGELOG.md; then
|
||||
echo "CHANGELOG.md was modified in this PR."
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Post a warning about modifying CHANGELOG.md
|
||||
if: steps.changelog-check.outputs.changed == 'true'
|
||||
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: >-
|
||||
⚠️ CHANGELOG.md was modified in this PR. Please do not modify CHANGELOG.md directly.
|
||||
Instead, describe your change as a change-note. The CHANGELOG.md file will be automatically
|
||||
generated from change-notes. For more information,
|
||||
see [CONTRIBUTING.md](https://github.com/github/codeql-action/blob/main/CONTRIBUTING.md).
|
||||
|
||||
- name: "Backport: Check out base ref"
|
||||
id: checkout-base
|
||||
if: ${{ startsWith(github.head_ref, 'backport-') }}
|
||||
|
||||
Reference in New Issue
Block a user