Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.github/CODEOWNERS @neo4j/drivers
/.github/workflows/ @neo4j/drivers
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
cooldown:
default-days: 3
open-pull-requests-limit: 5
labels:
- "no changelog"
assignees:
- "robsdedude"
55 changes: 55 additions & 0 deletions .github/workflows/changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Changelog Entry

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]

permissions:
contents: read
pull-requests: read

jobs:
check:
name: Check changelog entry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Verify changelog entry or "no changelog" label
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
run: |
set -euo pipefail
if echo "$LABELS" | jq -e 'index("no changelog")' > /dev/null; then
echo "PR is labeled 'no changelog' - skipping check."
exit 0
fi
expected="^changelog\\.d/${PR_NUMBER}\\.[^/]+\\.md$"
matching=$(gh api "repos/$REPO/pulls/$PR_NUMBER/files" --paginate \
| jq -r '.[] | select(.status == "added") | .filename' \
| grep -E "$expected" \
|| true)
if [ -z "$matching" ]; then
echo "::error::PR must add a file named 'changelog.d/${PR_NUMBER}.<type>.md' or carry the 'no changelog' label."
echo "See changelog.d/README.md for how to create an entry."
exit 1
fi
echo "Found new changelog entry/entries:"
echo "$matching"
echo "Checking changelog entries contain '<ISSUES_LIST>' placeholder on the first line..."
missing=()
while IFS= read -r file; do
if ! head -n 1 "$file" | grep -qF '<ISSUES_LIST>'; then
missing+=("$file")
fi
done <<< "$matching"
if [ ${#missing[@]} -gt 0 ]; then
echo "::error::The following changelog entries must contain '<ISSUES_LIST>' on the first line:"
for f in "${missing[@]}"; do
echo " - $f"
done
echo "See changelog.d/README.md for the expected format."
exit 1
fi
7 changes: 6 additions & 1 deletion changelog.d/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# How To Changelog

To create a new entry, you can run:

```bash
towncrier create "<PR number>.<type>"
```

This will create a new file in the `changelog.d/` directory for you to fill in.
If there is no issue or PR number, you can use `+.<type>` instead.
The `<type>` determines how the entry will be grouped in the changelog.
For available types, see the `[[tool.towncrier.type]]` entries in the `pyproject.toml` file.

You can include `<ISSUES_LIST>` in the entry to determine where the list of PR/issue links goes.
The entry's first line must include `<ISSUES_LIST>.` to determine where the list of PR/issue links goes.
Usually, the entries will look like this:

```markdown
Some summary of the change<ISSUES_LIST>.
```

or if there's more to say (note the trailing spaces after the first line):

```markdown
Some summary of the change<ISSUES_LIST>.
Some more details. Feel free to use markdown features like
Expand Down