Skip to content

Bfops/test pr

Bfops/test pr #1

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'
});