Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions demo/Blackholio/.github/workflows/repo-migration-notice.yml
Original file line number Diff line number Diff line change
@@ -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'
});
60 changes: 60 additions & 0 deletions docs/.github/workflows/repo-migration-notice.yml
Original file line number Diff line number Diff line change
@@ -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'
});
60 changes: 60 additions & 0 deletions sdks/csharp/.github/workflows/repo-migration-notice.yml
Original file line number Diff line number Diff line change
@@ -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'
});
60 changes: 60 additions & 0 deletions sdks/typescript/.github/workflows/repo-migration-notice.yml
Original file line number Diff line number Diff line change
@@ -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'
});
Loading