File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,28 +17,28 @@ jobs:
1717 const pr = context.payload.pull_request;
1818 const headRef = pr.head.ref;
1919 const prBody = pr.body || '';
20-
20+
2121 // ghstack branches follow pattern: gh/<username>/<number>/head
2222 const isGhstack = /^gh\/[^/]+\/\d+\/head$/.test(headRef);
23-
23+
2424 if (!isGhstack) {
2525 core.info('No ghstack patterns detected. PR is good to go!');
2626 return;
2727 }
28-
28+
2929 core.info('ghstack PR detected');
30-
30+
3131 // Check if we've already commented
3232 const { data: comments } = await github.rest.issues.listComments({
3333 owner: context.repo.owner,
3434 repo: context.repo.repo,
3535 issue_number: pr.number,
3636 });
37-
38- const alreadyCommented = comments.some(c =>
37+
38+ const alreadyCommented = comments.some(c =>
3939 c.user.type === 'Bot' && c.body.includes('ghstack PRs are not supported')
4040 );
41-
41+
4242 if (!alreadyCommented) {
4343 await github.rest.issues.createComment({
4444 owner: context.repo.owner,
5252 1. Create a branch from main
5353 2. Cherry-pick or apply your changes
5454 3. Open a new pull request
55-
55+
5656 See our [Contributing Guide](https://github.com/pytorch/tutorials/blob/main/CONTRIBUTING.md) for details.`,
5757 });
5858 }
59-
59+
6060 core.setFailed('ghstack PRs are not supported. Please resubmit as a regular pull request.');
You can’t perform that action at this time.
0 commit comments