pull/2361/head
Cory LaViska 2025-02-03 15:03:50 -05:00
rodzic fce7f7c98d
commit afc2b06709
1 zmienionych plików z 13 dodań i 21 usunięć
.github/workflows

Wyświetl plik

@ -5,35 +5,27 @@ on:
types: [opened, synchronize, reopened]
jobs:
check-changelog:
changelog:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for changelog entry
id: changelog-check
- name: Check for changelog updates
run: |
# Get the files changed in this PR
git fetch origin ${{ github.base_ref }}
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
# Check if docs/pages/resources/changelog.md was modified
if echo "$CHANGED_FILES" | grep -q "docs/pages/resources/changelog.md"; then
echo "Changelog was modified ✅"
echo "has_changelog=true" >> $GITHUB_OUTPUT
else
echo "No changelog entry found ❌"
echo "has_changelog=false" >> $GITHUB_OUTPUT
if ! git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -q "docs/pages/resources/changelog.md"; then
echo "no_changelog=true" >> $GITHUB_ENV
fi
- name: Comment on PR
if: steps.changelog-check.outputs.has_changelog == 'false'
uses: peter-evans/create-or-update-comment@v3
if: env.no_changelog == 'true'
uses: actions/github-script@v7
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
⚠️ This PR is missing a changelog entry. Please add an entry to `docs/pages/resources/changelog.md` describing your changes.
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.name,
issue_number: context.issue.number,
body: '❌ No changelog entry was found. Please add an entry to `docs/pages/resources/changelog.md`.'
})