Skip to content

Commit

Permalink
sigh
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Feb 3, 2025
1 parent fce7f7c commit afc2b06
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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`.'
})

0 comments on commit afc2b06

Please sign in to comment.