Skip to content
This repository was archived by the owner on Aug 2, 2024. It is now read-only.

Commit a344336

Browse files
authored
Add documentation (#14)
1 parent 16220d4 commit a344336

File tree

3 files changed

+46
-8
lines changed

3 files changed

+46
-8
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ To send us a pull request, please:
3232
1. Fork the repository.
3333
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3434
3. Ensure local tests pass.
35-
4. Commit to your fork using clear commit messages.
36-
5. Send us a pull request, answering any default questions in the pull request interface.
37-
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
35+
4. Make sure you run `yarn package`! GitHub expects the runnable action code to exist in dist/
36+
5. Commit to your fork using clear commit messages.
37+
6. Send us a pull request, answering any default questions in the pull request interface.
38+
7. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3839

3940
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4041
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
1-
## My Project
1+
# Pull Request Exclusion Action for GitHub Actions
22

3-
TODO: Fill this README out!
3+
Sometimes, you don't want to accept pull requests on GitHub against some parts
4+
of your code. This GitHub action accepts a regular expression as an argument,
5+
and if your repository receives a pull request with a pathspec that matches,
6+
the pull request will be automatically closed with a message.
47

5-
Be sure to:
8+
## Building and testing
69

7-
* Change the title in this README
8-
* Edit your repository description on GitHub
10+
Install dependencies
11+
```bash
12+
$ yarn install
13+
```
14+
15+
Build and test
16+
```bash
17+
$ yarn run all
18+
```
19+
## Usage
20+
21+
You need to add a workflow file into your repository under
22+
[.github/workflows](./.github/workflows), just like any other Github Action.
23+
This workflow file [follows the standard workflow syntax for Github Actions.](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions).
24+
25+
A sample workflow file for you to use as a drop-in is in [sample_workflow.yml](./sample_workflow.yml).
26+
27+
**NOTE:** For stability, you should use the action with either an
28+
explicit tag, or commit SHA:
929

1030
## Security
1131

sample_workflow.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Check for unacceptable PR"
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
verify:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: aws-actions/pr-regex-exclude@<commit_sha>
10+
with:
11+
exclude-regex: '<your JS RegEx syntax here>'
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
message: |
14+
Thank you for submitting this PR, but it appears that at least one file in this
15+
request is against a part of our codebase that does not accept pull requests.
16+
Please check the [contributing guide](./CONTRIBUTING.md) for more information.
17+
I am a bot; this action was performed automatically.

0 commit comments

Comments
 (0)