diff --git a/demo/Blackholio/.github/workflows/repo-migration-notice.yml b/demo/Blackholio/.github/workflows/repo-migration-notice.yml new file mode 100644 index 00000000000..e3cc94fa4b5 --- /dev/null +++ b/demo/Blackholio/.github/workflows/repo-migration-notice.yml @@ -0,0 +1,60 @@ +name: Repo migration notice + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Add comment + uses: actions/github-script@v7 + env: + migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB + migrated_path: demo/Blackholio + default_branch: master + with: + script: | + const isPR = context.eventName === 'pull_request'; + const number = isPR ? context.payload.pull_request.number : context.payload.issue.number; + + let message; + if (isPR) { + message = ` + Thank you for submitting this! + + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). + + To make sure we see your PR, please open it in the [SpacetimeDB](${process.env.migrated_repo}) repo, under [${process.env.migrated_path}](${process.env.migrated_repo}/tree/master/${process.env.migrated_path}). + + Apologies for the inconvenience, and thank you again! + `; + } else { + message = ` + Thank you for submitting this! + + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). + + To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new). + + Apologies for the inconvenience, and thank you again! + `; + } + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: number, + body: message + }); + + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: number, + state: 'closed' + }); diff --git a/docs/.github/workflows/repo-migration-notice.yml b/docs/.github/workflows/repo-migration-notice.yml new file mode 100644 index 00000000000..9794bb04766 --- /dev/null +++ b/docs/.github/workflows/repo-migration-notice.yml @@ -0,0 +1,60 @@ +name: Repo migration notice + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Add comment + uses: actions/github-script@v7 + env: + migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB + migrated_path: docs + default_branch: master + with: + script: | + const isPR = context.eventName === 'pull_request'; + const number = isPR ? context.payload.pull_request.number : context.payload.issue.number; + + let message; + if (isPR) { + message = ` + Thank you for submitting this! + + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). + + To make sure we see your PR, please open it in the [SpacetimeDB](${process.env.migrated_repo}) repo, under [${process.env.migrated_path}](${process.env.migrated_repo}/tree/master/${process.env.migrated_path}). + + Apologies for the inconvenience, and thank you again! + `; + } else { + message = ` + Thank you for submitting this! + + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). + + To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new). + + Apologies for the inconvenience, and thank you again! + `; + } + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: number, + body: message + }); + + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: number, + state: 'closed' + }); diff --git a/sdks/csharp/.github/workflows/repo-migration-notice.yml b/sdks/csharp/.github/workflows/repo-migration-notice.yml new file mode 100644 index 00000000000..0a21a173e44 --- /dev/null +++ b/sdks/csharp/.github/workflows/repo-migration-notice.yml @@ -0,0 +1,60 @@ +name: Repo migration notice + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Add comment + uses: actions/github-script@v7 + env: + migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB + migrated_path: sdks/csharp + default_branch: release/latest + with: + script: | + const isPR = context.eventName === 'pull_request'; + const number = isPR ? context.payload.pull_request.number : context.payload.issue.number; + + let message; + if (isPR) { + message = ` + Thank you for submitting this! + + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). + + To make sure we see your PR, please open it in the [SpacetimeDB](${process.env.migrated_repo}) repo, under [${process.env.migrated_path}](${process.env.migrated_repo}/tree/master/${process.env.migrated_path}). + + Apologies for the inconvenience, and thank you again! + `; + } else { + message = ` + Thank you for submitting this! + + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). + + To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new). + + Apologies for the inconvenience, and thank you again! + `; + } + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: number, + body: message + }); + + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: number, + state: 'closed' + }); diff --git a/sdks/typescript/.github/workflows/repo-migration-notice.yml b/sdks/typescript/.github/workflows/repo-migration-notice.yml new file mode 100644 index 00000000000..e15168008a8 --- /dev/null +++ b/sdks/typescript/.github/workflows/repo-migration-notice.yml @@ -0,0 +1,60 @@ +name: Repo migration notice + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + comment: + runs-on: ubuntu-latest + + steps: + - name: Add comment + uses: actions/github-script@v7 + env: + migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB + migrated_path: sdks/typescript + default_branch: main + with: + script: | + const isPR = context.eventName === 'pull_request'; + const number = isPR ? context.payload.pull_request.number : context.payload.issue.number; + + let message; + if (isPR) { + message = ` + Thank you for submitting this! + + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). + + To make sure we see your PR, please open it in the [SpacetimeDB](${process.env.migrated_repo}) repo, under [${process.env.migrated_path}](${process.env.migrated_repo}/tree/master/${process.env.migrated_path}). + + Apologies for the inconvenience, and thank you again! + `; + } else { + message = ` + Thank you for submitting this! + + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). + + To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new). + + Apologies for the inconvenience, and thank you again! + `; + } + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: number, + body: message + }); + + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: number, + state: 'closed' + });