|
| 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 | + default_branch: release/latest |
| 20 | + with: |
| 21 | + script: | |
| 22 | + const isPR = context.eventName === 'pull_request'; |
| 23 | + const number = isPR ? context.payload.pull_request.number : context.payload.issue.number; |
| 24 | +
|
| 25 | + let message; |
| 26 | + if (isPR) { |
| 27 | + message = ` |
| 28 | + Thank you for submitting this! |
| 29 | +
|
| 30 | + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). |
| 31 | +
|
| 32 | + 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}). |
| 33 | +
|
| 34 | + Apologies for the inconvenience, and thank you again! |
| 35 | + `; |
| 36 | + } else { |
| 37 | + message = ` |
| 38 | + Thank you for submitting this! |
| 39 | +
|
| 40 | + We are in the process of migrating this repository (see [DEVELOP.md](../blob/${process.env.default_branch}/DEVELOP.md)). |
| 41 | +
|
| 42 | + To make sure we actually see your issue, please open it here: [SpacetimeDB/issues/new](${process.env.migrated_repo}/issues/new). |
| 43 | +
|
| 44 | + Apologies for the inconvenience, and thank you again! |
| 45 | + `; |
| 46 | + } |
| 47 | +
|
| 48 | + await github.rest.issues.createComment({ |
| 49 | + owner: context.repo.owner, |
| 50 | + repo: context.repo.repo, |
| 51 | + issue_number: number, |
| 52 | + body: message |
| 53 | + }); |
| 54 | +
|
| 55 | + await github.rest.issues.update({ |
| 56 | + owner: context.repo.owner, |
| 57 | + repo: context.repo.repo, |
| 58 | + issue_number: number, |
| 59 | + state: 'closed' |
| 60 | + }); |
0 commit comments