Skip to content

Commit ddbce7c

Browse files
committed
Run the changelog PR reference check in CI
Add a mise task for the script and run it in the lint job of pull requests, fetching the full history so that the script can find the merge base and the branches the pull request merged in. #1236 Changelog: none Assisted-by: Claude Code:claude-opus-5-5
1 parent 2d50c58 commit ddbce7c

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎.github/workflows/main.yaml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,19 @@ jobs:
253253
runs-on: ubuntu-latest
254254
steps:
255255
- uses: actions/checkout@v6
256+
with:
257+
# '0' as a string: the number 0 is falsy in expressions
258+
fetch-depth: ${{ github.event_name == 'pull_request' && '0' || '1' }}
256259
- uses: ./.github/actions/setup-mise
257260
- run: mise run check
261+
- if: github.event_name == 'pull_request' && github.repository == 'fedify-dev/fedify'
262+
env:
263+
PR_NUMBER: ${{ github.event.pull_request.number }}
264+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
265+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
266+
run: >-
267+
mise run --skip-deps check:changelog-pr-refs --
268+
--pr "$PR_NUMBER" --base "$BASE_SHA" --head "$HEAD_SHA"
258269
259270
release-test:
260271
runs-on: ubuntu-latest

‎mise.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ deno run --allow-read --allow-write scripts/check_versions.ts ...$fix_args ...$s
230230
description = "Ensure @fedify/fixture is only used in **/*.test.ts files"
231231
run = "deno run --allow-read scripts/check_fixture_usage.ts"
232232

233+
[tasks."check:changelog-pr-refs"]
234+
description = "Check that changelog entries added by a pull request reference it"
235+
run = "deno run --allow-read --allow-run=git scripts/check_changelog_pr_refs.ts"
236+
233237
[tasks."check:workspace-protocol"]
234238
description = "Check for invalid workspace: specifiers without version (*, ^, ~)"
235239
run = "deno run --allow-read scripts/check_workspace_protocol.ts"

0 commit comments

Comments
 (0)