From 506a4d373b941dfd0a2eb43cce717a96c8314594 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Tue, 5 Aug 2025 12:41:23 -0700 Subject: [PATCH 1/2] [master]: repo migration notice workflows --- .../workflows/repo-migration-notice.yml | 59 +++++++++++++++++++ .../workflows/repo-migration-notice.yml | 59 +++++++++++++++++++ .../workflows/repo-migration-notice.yml | 59 +++++++++++++++++++ .../workflows/repo-migration-notice.yml | 59 +++++++++++++++++++ 4 files changed, 236 insertions(+) create mode 100644 demo/Blackholio/.github/workflows/repo-migration-notice.yml create mode 100644 docs/.github/workflows/repo-migration-notice.yml create mode 100644 sdks/csharp/.github/workflows/repo-migration-notice.yml create mode 100644 sdks/typescript/.github/workflows/repo-migration-notice.yml 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..c9b5a71aafc --- /dev/null +++ b/demo/Blackholio/.github/workflows/repo-migration-notice.yml @@ -0,0 +1,59 @@ +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 + 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/master/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/master/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..a5364487506 --- /dev/null +++ b/docs/.github/workflows/repo-migration-notice.yml @@ -0,0 +1,59 @@ +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 + 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 [README.md](../blob/master/README.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 [README.md](../blob/master/README.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..ff0aee7ba0b --- /dev/null +++ b/sdks/csharp/.github/workflows/repo-migration-notice.yml @@ -0,0 +1,59 @@ +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 + 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/release/latest/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/release/latest/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..902d052edbb --- /dev/null +++ b/sdks/typescript/.github/workflows/repo-migration-notice.yml @@ -0,0 +1,59 @@ +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 + 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/main/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/main/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' + }); From 9a398a4b7f6f4c9a4799194f9d207f32bdbd9c4d Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Tue, 5 Aug 2025 12:42:43 -0700 Subject: [PATCH 2/2] [master]: refactor --- demo/Blackholio/.github/workflows/repo-migration-notice.yml | 5 +++-- docs/.github/workflows/repo-migration-notice.yml | 5 +++-- sdks/csharp/.github/workflows/repo-migration-notice.yml | 5 +++-- sdks/typescript/.github/workflows/repo-migration-notice.yml | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/demo/Blackholio/.github/workflows/repo-migration-notice.yml b/demo/Blackholio/.github/workflows/repo-migration-notice.yml index c9b5a71aafc..e3cc94fa4b5 100644 --- a/demo/Blackholio/.github/workflows/repo-migration-notice.yml +++ b/demo/Blackholio/.github/workflows/repo-migration-notice.yml @@ -16,6 +16,7 @@ jobs: env: migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB migrated_path: demo/Blackholio + default_branch: master with: script: | const isPR = context.eventName === 'pull_request'; @@ -26,7 +27,7 @@ jobs: message = ` Thank you for submitting this! - We are in the process of migrating this repository (see [DEVELOP.md](../blob/master/DEVELOP.md)). + 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}). @@ -36,7 +37,7 @@ jobs: message = ` Thank you for submitting this! - We are in the process of migrating this repository (see [DEVELOP.md](../blob/master/DEVELOP.md)). + 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). diff --git a/docs/.github/workflows/repo-migration-notice.yml b/docs/.github/workflows/repo-migration-notice.yml index a5364487506..9794bb04766 100644 --- a/docs/.github/workflows/repo-migration-notice.yml +++ b/docs/.github/workflows/repo-migration-notice.yml @@ -16,6 +16,7 @@ jobs: env: migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB migrated_path: docs + default_branch: master with: script: | const isPR = context.eventName === 'pull_request'; @@ -26,7 +27,7 @@ jobs: message = ` Thank you for submitting this! - We are in the process of migrating this repository (see [README.md](../blob/master/README.md)). + 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}). @@ -36,7 +37,7 @@ jobs: message = ` Thank you for submitting this! - We are in the process of migrating this repository (see [README.md](../blob/master/README.md)). + 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). diff --git a/sdks/csharp/.github/workflows/repo-migration-notice.yml b/sdks/csharp/.github/workflows/repo-migration-notice.yml index ff0aee7ba0b..0a21a173e44 100644 --- a/sdks/csharp/.github/workflows/repo-migration-notice.yml +++ b/sdks/csharp/.github/workflows/repo-migration-notice.yml @@ -16,6 +16,7 @@ jobs: env: migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB migrated_path: sdks/csharp + default_branch: release/latest with: script: | const isPR = context.eventName === 'pull_request'; @@ -26,7 +27,7 @@ jobs: message = ` Thank you for submitting this! - We are in the process of migrating this repository (see [DEVELOP.md](../blob/release/latest/DEVELOP.md)). + 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}). @@ -36,7 +37,7 @@ jobs: message = ` Thank you for submitting this! - We are in the process of migrating this repository (see [DEVELOP.md](../blob/release/latest/DEVELOP.md)). + 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). diff --git a/sdks/typescript/.github/workflows/repo-migration-notice.yml b/sdks/typescript/.github/workflows/repo-migration-notice.yml index 902d052edbb..e15168008a8 100644 --- a/sdks/typescript/.github/workflows/repo-migration-notice.yml +++ b/sdks/typescript/.github/workflows/repo-migration-notice.yml @@ -16,6 +16,7 @@ jobs: env: migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB migrated_path: sdks/typescript + default_branch: main with: script: | const isPR = context.eventName === 'pull_request'; @@ -26,7 +27,7 @@ jobs: message = ` Thank you for submitting this! - We are in the process of migrating this repository (see [DEVELOP.md](../blob/main/DEVELOP.md)). + 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}). @@ -36,7 +37,7 @@ jobs: message = ` Thank you for submitting this! - We are in the process of migrating this repository (see [DEVELOP.md](../blob/main/DEVELOP.md)). + 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).