Skip to content

Commit

Permalink
🚦 Add workflow for automatic pull requests
Browse files Browse the repository at this point in the history
This project currently does not accept third-party contributions,
but github does not offer a way to disable this. To work around it,
this adds a workflow that will automatically close PRs that are opened
or reopened, and leaves a comment explaining the rationale for it.
  • Loading branch information
bitwizeshift committed Dec 16, 2023
1 parent e606099 commit 4742b93
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/actions/github-close-pr/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: github-close-pr
description: "A tool for automatically closing pull requests"

inputs:
message:
required: true
description: "The message to comment. This may contain "

runs:
using: "composite"
steps:
- name: Leave Issue or Pull Request comment
uses: actions/github-script@v7
with:
retries: 3
script: |
github.rest.pulls.update({
pull_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed'
});
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build
on:
push:
branches: [master, feature/*]
pull_request:
branches: [master]
# pull_request:
# branches: [master]
workflow_call:
workflow_dispatch:

Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/close-pull-requests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Close Pull Requests
on:
pull_request_target:
types: [opened, reopened]

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Leave comment
uses: ./.github/actions/github-comment
with:
message: |
👋🏻 Hi, thank you for your interest in this project.
I sincerely appreciate your enthusiasm and eagerness to contribute,
as public contributions are fundamental to the open-source community.
However, at this moment, I am **not actively accepting external
contributions**. This project primarily exists to experiment and
learn about game engine design in Rust -- and as such has a much
looser focus and roadmap that is currently aligned with specific
goals.
It is possible that this may change in the future; so please consider
starring this project to keep an eye on future updates for
opportunities to contribute and collaborate. Your support and
understanding are highly valued.
This project does have
[💬 Github Discussion](https://github.com/{{github.repo}}/discussions)
enabled if there are suggestions for improvements or reasonable
feature requests.
Thank you! 🙇‍♂️
- name: Close pull request
uses: ./.github/actions/github-close-pr

0 comments on commit 4742b93

Please sign in to comment.