Skip to content

Commit b02bcaf

Browse files
authored
Merge pull request DeusData#1270 from DeusData/feat/pr-acknowledgement
feat(ci): acknowledge new pull requests automatically
2 parents 63a244a + 05dc3fc commit b02bcaf

2 files changed

Lines changed: 101 additions & 0 deletions

File tree

‎.github/pr-acknowledgement.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--
2+
Posted automatically on every newly opened pull request by
3+
.github/workflows/pr-acknowledgement.yml
4+
5+
EDIT THIS FILE to change what contributors are told. Blank it out to stop
6+
posting acknowledgements entirely — no workflow change needed.
7+
8+
Keep it short, and keep it honest about what happens next. A promise of a
9+
timeline you will not meet is worse than no acknowledgement at all.
10+
Remove the review-status section below the moment it stops being true.
11+
-->
12+
13+
Thanks for opening this — it has been seen, and it is queued.
14+
15+
This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.
16+
17+
**Current review status: working through a backlog.** `0.9.1-rc.1` is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in [discussion #1144](https://github.com/DeusData/codebase-memory-mcp/discussions/1144).
18+
19+
What that means for this PR, concretely:
20+
21+
- **It will not be closed for inactivity.** No stale bot touches pull requests here.
22+
- It may still sit a while before a human reads it. That is on us, not on you.
23+
- Older PRs are read first, so a recent one is not being skipped — it is behind a queue.
24+
25+
Things that will genuinely speed it up whenever review does happen:
26+
27+
- **Keep it rebased** on `main` — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
28+
- **Get CI green**, or say which failures you believe are pre-existing.
29+
- **Keep the change to one claim.** Bundled features and refactors get split before they get merged, which costs you a round trip.
30+
- Every commit needs a sign-off (`git commit -s`) — CI enforces DCO.
31+
32+
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.
33+
34+
Thanks for contributing, and sorry in advance for the wait.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: PR acknowledgement
2+
3+
# Posts one acknowledgement comment when a pull request is opened, so a
4+
# contributor learns the current review status immediately instead of inferring
5+
# it from silence.
6+
#
7+
# The message text lives in `.github/pr-acknowledgement.md`. Edit that file to
8+
# change what is said; blank it (or delete it) to turn acknowledgements off
9+
# without touching this workflow. No code change is needed to switch it.
10+
#
11+
# SECURITY — this uses `pull_request_target`, which runs against the BASE repo
12+
# with a token that can write. That is required: a `pull_request` trigger gives
13+
# fork PRs a read-only token, so commenting on exactly the contributions we most
14+
# want to acknowledge would fail.
15+
#
16+
# The safety rule that makes it sound: this job NEVER checks out, builds, or
17+
# executes pull-request code. `actions/checkout` here resolves to the base
18+
# commit (the default under `pull_request_target`), and it is used only to read
19+
# the message file out of our own tree. Do not add a `ref:` pointing at the PR
20+
# head, and do not add a build step. Nothing from the PR is interpolated into a
21+
# shell command either — the body comes from a file, and the PR number is passed
22+
# through the environment rather than expanded inline.
23+
24+
on:
25+
pull_request_target:
26+
types: [opened]
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
acknowledge:
33+
runs-on: ubuntu-latest
34+
# Bots do not read comments, and acknowledging our own PRs is noise.
35+
if: >-
36+
github.event.pull_request.user.type != 'Bot' &&
37+
github.event.pull_request.author_association != 'OWNER'
38+
permissions:
39+
pull-requests: write
40+
steps:
41+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
42+
with:
43+
# Base commit only — never the PR head. See the security note above.
44+
persist-credentials: false
45+
46+
- name: Post acknowledgement
47+
env:
48+
GH_TOKEN: ${{ github.token }}
49+
PR_NUMBER: ${{ github.event.pull_request.number }}
50+
REPO: ${{ github.repository }}
51+
run: |
52+
set -euo pipefail
53+
MESSAGE_FILE=.github/pr-acknowledgement.md
54+
55+
if [ ! -f "$MESSAGE_FILE" ]; then
56+
echo "No $MESSAGE_FILE in the base tree — acknowledgements are off."
57+
exit 0
58+
fi
59+
60+
# An empty or whitespace-only file is the documented off switch.
61+
if [ -z "$(tr -d '[:space:]' < "$MESSAGE_FILE")" ]; then
62+
echo "$MESSAGE_FILE is blank — acknowledgements are off."
63+
exit 0
64+
fi
65+
66+
gh pr comment "$PR_NUMBER" --repo "$REPO" --body-file "$MESSAGE_FILE"
67+
echo "Acknowledged PR #${PR_NUMBER}."

0 commit comments

Comments
 (0)