Skip to content

docs: version 0.46.0 docs #2506

docs: version 0.46.0 docs

docs: version 0.46.0 docs #2506

Workflow file for this run

name: Changelog
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
changelog:
name: Verify Changelog
runs-on: ubuntu-latest
# Skip for any dependabot PR - the label-based skip is not reliable
# (security PRs in particular open without honoring dependabot.yml
# labels) - and for PRs with [skip changelog] in the title or the
# skip-changelog label. The "[skip changelog] in a commit message"
# escape hatch is handled in the step below, since commit messages are
# not available in this job-level `if:` expression.
if: |
github.event.pull_request.user.login != 'dependabot[bot]' &&
!contains(github.event.pull_request.title, '[skip changelog]') &&
!contains(github.event.pull_request.labels.*.name, 'skip-changelog')
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Check CHANGELOG.md modified
env:
BASE_REF: ${{ github.base_ref }}
run: |
set -euo pipefail
range="origin/${BASE_REF}...HEAD"
# Commit-message escape hatch: the PR title and label are checked in
# the job-level `if:`, but a `[skip changelog]` marker in any commit
# on the branch should also skip the gate (matches how it reads in a
# commit body, e.g. dependency or CI-only changes).
if git log --format='%B' "$range" | grep -qF '[skip changelog]'; then
echo "[skip changelog] found in a commit message - skipping changelog check"
exit 0
fi
changed_files=$(git diff --name-only "$range")
if grep -qF "CHANGELOG.md" <<< "$changed_files"; then
echo "CHANGELOG.md has been modified"
else
echo "::error::CHANGELOG.md was not modified. Please add an entry describing your changes."
echo ""
echo "If this PR doesn't require a changelog entry, you can:"
echo " - Add [skip changelog] to the PR title or any commit message"
echo " - Add the 'skip-changelog' label to the PR"
exit 1
fi