├── workflow-templates ├── auto-close-pr.properties.json └── auto-close-pr.yml ├── .github └── workflows │ └── auto-close-pr.yml └── profile └── README.md /workflow-templates/auto-close-pr.properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Auto close PRs", 3 | "description": "Automatically close pull requests from non-staff." 4 | } -------------------------------------------------------------------------------- /.github/workflows/auto-close-pr.yml: -------------------------------------------------------------------------------- 1 | name: Auto Close PRs 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened, reopened] 6 | 7 | jobs: 8 | check_pr: 9 | name: Check PR 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Check if employee 14 | id: check_employee 15 | uses: actions/github-script@v6 16 | with: 17 | github-token: ${{ secrets.READ_GITHUB_ORG_MEMBERS_TOKEN }} 18 | result-encoding: string 19 | script: | 20 | try { 21 | const response = await github.rest.orgs.checkMembershipForUser({ 22 | org: `github`, 23 | username: context.payload.pull_request.user.login 24 | }); 25 | 26 | if (response.status === 204) { 27 | return true; 28 | } else { 29 | return false; 30 | } 31 | } catch (error) { 32 | console.log(error); 33 | return 'false'; 34 | } 35 | 36 | - name: Close PR 37 | id: close_pr 38 | if: ${{ steps.check_employee.outputs.result == 'false' }} 39 | uses: actions/github-script@v6 40 | with: 41 | github-token: ${{ secrets.GITHUB_TOKEN }} 42 | script: | 43 | const body = `This pull request is being automatically closed because we do not accept external contributions to this repository.`; 44 | 45 | await github.rest.issues.createComment({ 46 | ...context.repo, 47 | issue_number: context.issue.number, 48 | body: body 49 | }); 50 | 51 | await github.rest.pulls.update({ 52 | ...context.repo, 53 | pull_number: context.payload.pull_request.number, 54 | state: 'closed' 55 | }); -------------------------------------------------------------------------------- /workflow-templates/auto-close-pr.yml: -------------------------------------------------------------------------------- 1 | name: Auto Close PRs 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened, reopened] 6 | 7 | jobs: 8 | check_pr: 9 | name: Check PR 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Check if employee 14 | id: check_employee 15 | uses: actions/github-script@v6 16 | with: 17 | github-token: ${{ secrets.READ_GITHUB_ORG_MEMBERS_TOKEN }} 18 | result-encoding: string 19 | script: | 20 | try { 21 | const response = await github.rest.orgs.checkMembershipForUser({ 22 | org: `github`, 23 | username: context.payload.pull_request.user.login 24 | }); 25 | 26 | if (response.status === 204) { 27 | return true; 28 | } else { 29 | return false; 30 | } 31 | } catch (error) { 32 | console.log(error); 33 | return 'false'; 34 | } 35 | 36 | - name: Close PR 37 | id: close_pr 38 | if: ${{ steps.check_employee.outputs.result == 'false' }} 39 | uses: actions/github-script@v6 40 | with: 41 | github-token: ${{ secrets.GITHUB_TOKEN }} 42 | script: | 43 | const body = `This pull request is being automatically closed because we do not accept external contributions to this repository.`; 44 | 45 | await github.rest.issues.createComment({ 46 | ...context.repo, 47 | issue_number: context.issue.number, 48 | body: body 49 | }); 50 | 51 | await github.rest.pulls.update({ 52 | ...context.repo, 53 | pull_number: context.payload.pull_request.number, 54 | state: 'closed' 55 | }); -------------------------------------------------------------------------------- /profile/README.md: -------------------------------------------------------------------------------- 1 | ![image](https://user-images.githubusercontent.com/6633808/160689302-3fe5e5d4-ba24-4525-8ed1-a8351ccbc0ef.png) 2 | 3 | GitHub Community is built to support all GitHub users on their educational journey, via Discussions. It is a resource hub, learning portal, and inspiration station, all in one. Regardless of how big or small your challenge is, all resources and information will be accessible in a true open source fashion. 4 | 5 | ### Quick Start 6 | 7 | * [Discussions & Product Feedback](https://github.com/orgs/community/discussions) 8 | * [Join Global Campus](https://education.github.com/benefits?type=student) 9 | * [GitHub Community Guidelines](https://docs.github.com/en/site-policy/github-terms/github-community-guidelines) 10 | * [Student Developer Pack Application & FAQs](https://github.com/orgs/community/discussions/17814) 11 | 12 | ### Documentation 13 | 14 | * [GitHub Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) 15 | * [GitHub Community Forum Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-community-forum-code-of-conduct) 16 | 17 | ### Other Ways to Participate 18 | 19 | * [GitHub Stars Program](https://stars.github.com/program/) 20 | * [GitHub Campus Experts Program](https://education.github.com/experts) 21 | * [GitHub Events](https://www.meetup.com/pro/github-virtual-meetup/) 22 | * [GitHub Blog](https://github.blog/) 23 | * [The ReadME Project & Podcast](https://github.com/readme) 24 | * [GitHub YouTube Channel](https://www.youtube.com/github) 25 | 26 | #### Quick note on 3rd party integrations 27 | > _Due to an overwhelming number of suspicious requests from community members for 3rd party apps and integrations to this org, we've turned off "Allow integration requests from outside collaborators"._ 28 | 29 | #### Quick note on temporary interaction limits 30 | In an effort to reduce spammy behavior, we are instituting temporary interaction limits to bar accounts less than 24hrs-old from participating in the `github.com/community` Discussions space. 31 | Accounts that are at least 24hrs old will be able to post and interact as normal. 32 | 33 | If your account is less than 24hrs old and you have a question, please try using the Discussions search bar above to see if your question has already been asked or simply wait a day. We apologize if this causes any inconvenience. 34 | 35 | If you'd like to learn more about implementing temporary interaction limits in your own orgs and repos, please read up on the official documentation [here](https://docs.github.com/en/communities/moderating-comments-and-conversations/limiting-interactions-in-your-organization). 36 | 37 | --------------------------------------------------------------------------------