auto-close PRs

This commit is contained in:
Elio Bischof
2025-06-24 03:12:18 +02:00
parent a0d31a6bb2
commit 905ae00382

35
.github/workflows/close_pr.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Auto-close PRs and guide to correct repo
on:
pull_request:
types: [opened]
jobs:
auto-close:
runs-on: ubuntu-latest
if: github.repository_owner == 'zitadel'
steps:
- name: Comment and close PR
uses: actions/github-script@v7
with:
script: |
const message = `
👋 **Thanks for your contribution!**
This repository \`${{ github.repository }}\` is a read-only mirror of our internal development in [\`zitadel/zitadel\`](https://github.com/zitadel/zitadel).
Therefore, we close this pull request automatically, but submitting your changes to the main repository is easy:
1. Fork and clone zitadel/zitadel
2. Create a new branch for your changes
3. Pull your changes into the new fork by running `make login-pull LOGIN_REMOTE_URL=<your-typescript-fork-org>/typescript LOGIN_REMOTE_BRANCH=<your-typescript-fork-branch>`.
4. Push your changes and open a pull request to zitadel/zitadel
`.trim();
await github.rest.issues.createComment({
...context.repo,
issue_number: context.issue.number,
body: message
});
await github.rest.pulls.update({
...context.repo,
pull_number: context.issue.number,
state: "closed"
});