-
-
Notifications
You must be signed in to change notification settings - Fork 24
26 lines (25 loc) · 1.09 KB
/
github--no-forks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: GitHub -- No Forks
on:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
no-forks:
runs-on: ubuntu-latest
steps:
- name: Comment and Close
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
if: ${{ github.event.pull_request.head.repo.full_name != 'freeCodeCamp/infra' }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "This is a quick reminder that we can not accept pull requests from forks (including staff and prior contributors).\n\nThis repo is a \"special\" case because of how we build, test and deploy the codebase. If you are working on something, Please open a new pull request from a branch on this repository."
})
github.rest.pulls.update({
pull_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed'
})