Skip to content

Commit 506a4d3

Browse files
committed
[master]: repo migration notice workflows
1 parent 606186e commit 506a4d3

4 files changed

Lines changed: 236 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Repo migration notice
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened]
8+
9+
jobs:
10+
comment:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Add comment
15+
uses: actions/github-script@v7
16+
env:
17+
migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB
18+
migrated_path: demo/Blackholio
19+
with:
20+
script: |
21+
const isPR = context.eventName === 'pull_request';
22+
const number = isPR ? context.payload.pull_request.number : context.payload.issue.number;
23+
24+
let message;
25+
if (isPR) {
26+
message = `
27+
Thank you for submitting this!
28+
29+
We are in the process of migrating this repository (see [DEVELOP.md](../blob/master/DEVELOP.md)).
30+
31+
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}).
32+
33+
Apologies for the inconvenience, and thank you again!
34+
`;
35+
} else {
36+
message = `
37+
Thank you for submitting this!
38+
39+
We are in the process of migrating this repository (see [DEVELOP.md](../blob/master/DEVELOP.md)).
40+
41+
To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new).
42+
43+
Apologies for the inconvenience, and thank you again!
44+
`;
45+
}
46+
47+
await github.rest.issues.createComment({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
issue_number: number,
51+
body: message
52+
});
53+
54+
await github.rest.issues.update({
55+
owner: context.repo.owner,
56+
repo: context.repo.repo,
57+
issue_number: number,
58+
state: 'closed'
59+
});
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Repo migration notice
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened]
8+
9+
jobs:
10+
comment:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Add comment
15+
uses: actions/github-script@v7
16+
env:
17+
migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB
18+
migrated_path: docs
19+
with:
20+
script: |
21+
const isPR = context.eventName === 'pull_request';
22+
const number = isPR ? context.payload.pull_request.number : context.payload.issue.number;
23+
24+
let message;
25+
if (isPR) {
26+
message = `
27+
Thank you for submitting this!
28+
29+
We are in the process of migrating this repository (see [README.md](../blob/master/README.md)).
30+
31+
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}).
32+
33+
Apologies for the inconvenience, and thank you again!
34+
`;
35+
} else {
36+
message = `
37+
Thank you for submitting this!
38+
39+
We are in the process of migrating this repository (see [README.md](../blob/master/README.md)).
40+
41+
To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new).
42+
43+
Apologies for the inconvenience, and thank you again!
44+
`;
45+
}
46+
47+
await github.rest.issues.createComment({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
issue_number: number,
51+
body: message
52+
});
53+
54+
await github.rest.issues.update({
55+
owner: context.repo.owner,
56+
repo: context.repo.repo,
57+
issue_number: number,
58+
state: 'closed'
59+
});
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Repo migration notice
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened]
8+
9+
jobs:
10+
comment:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Add comment
15+
uses: actions/github-script@v7
16+
env:
17+
migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB
18+
migrated_path: sdks/csharp
19+
with:
20+
script: |
21+
const isPR = context.eventName === 'pull_request';
22+
const number = isPR ? context.payload.pull_request.number : context.payload.issue.number;
23+
24+
let message;
25+
if (isPR) {
26+
message = `
27+
Thank you for submitting this!
28+
29+
We are in the process of migrating this repository (see [DEVELOP.md](../blob/release/latest/DEVELOP.md)).
30+
31+
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}).
32+
33+
Apologies for the inconvenience, and thank you again!
34+
`;
35+
} else {
36+
message = `
37+
Thank you for submitting this!
38+
39+
We are in the process of migrating this repository (see [DEVELOP.md](../blob/release/latest/DEVELOP.md)).
40+
41+
To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new).
42+
43+
Apologies for the inconvenience, and thank you again!
44+
`;
45+
}
46+
47+
await github.rest.issues.createComment({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
issue_number: number,
51+
body: message
52+
});
53+
54+
await github.rest.issues.update({
55+
owner: context.repo.owner,
56+
repo: context.repo.repo,
57+
issue_number: number,
58+
state: 'closed'
59+
});
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Repo migration notice
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened]
8+
9+
jobs:
10+
comment:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Add comment
15+
uses: actions/github-script@v7
16+
env:
17+
migrated_repo: https://github.com/ClockworkLabs/SpacetimeDB
18+
migrated_path: sdks/typescript
19+
with:
20+
script: |
21+
const isPR = context.eventName === 'pull_request';
22+
const number = isPR ? context.payload.pull_request.number : context.payload.issue.number;
23+
24+
let message;
25+
if (isPR) {
26+
message = `
27+
Thank you for submitting this!
28+
29+
We are in the process of migrating this repository (see [DEVELOP.md](../blob/main/DEVELOP.md)).
30+
31+
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}).
32+
33+
Apologies for the inconvenience, and thank you again!
34+
`;
35+
} else {
36+
message = `
37+
Thank you for submitting this!
38+
39+
We are in the process of migrating this repository (see [DEVELOP.md](../blob/main/DEVELOP.md)).
40+
41+
To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new).
42+
43+
Apologies for the inconvenience, and thank you again!
44+
`;
45+
}
46+
47+
await github.rest.issues.createComment({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
issue_number: number,
51+
body: message
52+
});
53+
54+
await github.rest.issues.update({
55+
owner: context.repo.owner,
56+
repo: context.repo.repo,
57+
issue_number: number,
58+
state: 'closed'
59+
});

0 commit comments

Comments
 (0)