Skip to content

Commit ab3b5b5

Browse files
committed
Initial commit
0 parents  commit ab3b5b5

File tree

11 files changed

+2289
-0
lines changed

11 files changed

+2289
-0
lines changed

.github/main.workflow

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
workflow "Lint JavaScript" {
2+
on = "push"
3+
resolves = ["Lint", "Formatting"]
4+
}
5+
6+
action "Lint" {
7+
uses = "actions/[email protected]"
8+
runs = "npx eslint --no-eslintrc --env es6 --parser-options ecmaVersion:2018 entrypoint.js"
9+
}
10+
11+
action "Formatting" {
12+
uses = "actions/[email protected]"
13+
runs = "npx prettier -c --no-semi --no-bracket-spacing --single-quote entrypoint.js"
14+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Contributing
2+
3+
[fork]: https://github.com/actions/labeler/fork
4+
[pr]: https://github.com/actions/labeler/compare
5+
[code-of-conduct]: https://github.com/actions/labeler/blob/master/CODE_OF_CONDUCT.md
6+
7+
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
8+
9+
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE.md).
10+
11+
Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms.
12+
13+
## Submitting a pull request
14+
15+
0. [Fork][fork] and clone the repository
16+
0. Configure and install the dependencies: `script/bootstrap`
17+
0. Make sure the tests pass on your machine: `rake`
18+
0. Create a new branch: `git checkout -b my-branch-name`
19+
0. Make your change, add tests, and make sure the tests still pass
20+
0. Push to your fork and [submit a pull request][pr]
21+
0. Pat your self on the back and wait for your pull request to be reviewed and merged.
22+
23+
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
24+
25+
- Write tests.
26+
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
27+
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
28+
29+
## Resources
30+
31+
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
32+
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
33+
- [GitHub Help](https://help.github.com)

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:slim
2+
3+
LABEL "name"="labeler"
4+
LABEL "maintainer"="GitHub Actions <[email protected]>"
5+
LABEL "version"="1.0.0"
6+
7+
LABEL "com.github.actions.name"="PR Labeller"
8+
LABEL "com.github.actions.description"="An action that labels pull requests according to changed files"
9+
LABEL "com.github.actions.icon"="tag"
10+
LABEL "com.github.actions.color"="orange"
11+
12+
COPY *.md /
13+
14+
COPY package*.json ./
15+
16+
RUN npm ci
17+
18+
COPY entrypoint.js /entrypoint.js
19+
20+
ENTRYPOINT ["node", "/entrypoint.js"]

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 GitHub
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Pull Request Labeller
2+
3+
This action labels pull requests by comparing their changed files to a configuration file in the repository.
4+
5+
For example, a configuration file at `.github/triage.yml` may look like this:
6+
7+
```yaml
8+
design:
9+
- src/frontend/**/*.css
10+
- src/frontend/**/*.png
11+
12+
server:
13+
- src/server/**/*
14+
```
15+
16+
And the action would be used like this:
17+
18+
```workflow
19+
workflow "Apply PR labels" {
20+
on = "pull_request"
21+
resolves = "Apply labels"
22+
}
23+
24+
action "On sync" {
25+
uses = "actions/bin/filter@master"
26+
args = "action synchronize"
27+
}
28+
29+
action "Apply labels" {
30+
uses = "actions/[email protected]"
31+
needs = "On sync"
32+
env = {LABEL_SPEC_FILE=".github/triage.yml"}
33+
secrets = ["GITHUB_TOKEN"]
34+
}
35+
```
36+
37+
Now, whenever a user pushes to a pull request, this action will determine whether any changed files in that pull request match the specification file (note: this action uses [minimatch](https://github.com/isaacs/minimatch) to determine matches). If there are matches, the action will apply the appropriate labels to the pull request.
38+
39+
## Contributing
40+
41+
Check out [this doc](CONTRIBUTING.md).
42+
43+
## License
44+
45+
This action is released under the [MIT license](LICENSE.md).
46+
Container images built with this project include third party materials. See [THIRD_PARTY_NOTICE.md](THIRD_PARTY_NOTICE.md) for details.
47+
48+
## Current Status
49+
50+
This action is in active development.

0 commit comments

Comments
 (0)