Skip to content

Commit d12d1e4

Browse files
authored
ci: auto-close PRs from forks and document the policy in README (#166)
1 parent e17150b commit d12d1e4

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Close fork PRs
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- reopened
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
close-fork-pr:
14+
runs-on: ubuntu-latest
15+
if: github.event.pull_request.head.repo.full_name != github.repository
16+
steps:
17+
- name: Comment and close
18+
uses: actions/github-script@v7
19+
with:
20+
script: |
21+
const pr = context.payload.pull_request;
22+
const issuesUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/issues/new`;
23+
const body = [
24+
`Hi @${pr.user.login}, thank you so much for taking the time to propose this change — we really appreciate the gesture! 🙏`,
25+
``,
26+
`A small note on how we work here: this site is maintained directly by the AiiDA team, and we kindly ask the community to share suggestions via **[issues](${issuesUrl})** rather than pull requests. Whatever the change — a typo, a broken link, outdated content, a content tweak, a bigger design idea — please describe it in an issue and we'll take it from there. The "Contributing" section of the README explains the why.`,
27+
``,
28+
`Closing this PR for now. Your commits are still on \`${pr.head.repo.full_name}:${pr.head.ref}\` if you'd like to link to them from an issue.`,
29+
].join("\n");
30+
await github.rest.issues.createComment({
31+
owner: context.repo.owner,
32+
repo: context.repo.repo,
33+
issue_number: pr.number,
34+
body,
35+
});
36+
await github.rest.pulls.update({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
pull_number: pr.number,
40+
state: "closed",
41+
});

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ npm run preview
2727

2828
The site is deployed to Cloudflare Pages.
2929

30+
## Contributing
31+
32+
Thanks for your interest in helping! This site is maintained directly by the AiiDA team, and we kindly ask the community to share feedback through [**issues**](https://github.com/aiidateam/aiida-website/issues/new) rather than pull requests. Whether it's a typo, a broken link, outdated content, or a content suggestion — please open an issue and we'll take care of the implementation. To keep the workflow consistent, PRs opened from forks are gently auto-closed with a comment pointing back here.
33+
34+
Two reasons behind the policy: (1) the site benefits from a single editorial voice, so changes flow through the team rather than landing piecemeal; and (2) Cloudflare Pages doesn't build preview deployments for fork PRs (a security default — the build environment can hold project secrets), so a fork PR can't be reviewed visually anyway. Routing through issues keeps the loop short for everyone.
35+
3036
## How to cite AiiDA
3137

3238
If AiiDA helped your research, please cite the relevant papers below.

0 commit comments

Comments
 (0)