-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implemented auto detection of protection mode
- Loading branch information
Showing
9 changed files
with
214 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as members, contributors, and leaders pledge to make participation in our | ||
community a harassment-free experience for everyone, regardless of age, body | ||
size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
identity and expression, level of experience, education, socio-economic status, | ||
nationality, personal appearance, race, religion, or sexual identity | ||
and orientation. | ||
|
||
We pledge to act and interact in ways that contribute to an open, welcoming, | ||
diverse, inclusive, and healthy community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our | ||
community include: | ||
|
||
- Demonstrating empathy and kindness toward other people | ||
- Being respectful of differing opinions, viewpoints, and experiences | ||
- Giving and gracefully accepting constructive feedback | ||
- Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
- Focusing on what is best not just for us as individuals, but for the | ||
overall community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
- The use of sexualized language or imagery, and sexual attention or | ||
advances of any kind | ||
- Trolling, insulting or derogatory comments, and personal or political attacks | ||
- Public or private harassment | ||
- Publishing others' private information, such as a physical or email | ||
address, without their explicit permission | ||
- Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
Community leaders are responsible for clarifying and enforcing our standards of | ||
acceptable behavior and will take appropriate and fair corrective action in | ||
response to any behavior that they deem inappropriate, threatening, offensive, | ||
or harmful. | ||
|
||
Community leaders have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct, and will communicate reasons for moderation | ||
decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when | ||
an individual is officially representing the community in public spaces. | ||
Examples of representing our community include using an official e-mail address, | ||
posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at | ||
[email protected]. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
reporter of any incident. | ||
|
||
## Enforcement Guidelines | ||
|
||
Community leaders will follow these Community Impact Guidelines in determining | ||
the consequences for any action they deem in violation of this Code of Conduct: | ||
|
||
### 1. Correction | ||
|
||
**Community Impact**: Use of inappropriate language or other behavior deemed | ||
unprofessional or unwelcome in the community. | ||
|
||
**Consequence**: A private, written warning from community leaders, providing | ||
clarity around the nature of the violation and an explanation of why the | ||
behavior was inappropriate. A public apology may be requested. | ||
|
||
### 2. Warning | ||
|
||
**Community Impact**: A violation through a single incident or series | ||
of actions. | ||
|
||
**Consequence**: A warning with consequences for continued behavior. No | ||
interaction with the people involved, including unsolicited interaction with | ||
those enforcing the Code of Conduct, for a specified period of time. This | ||
includes avoiding interactions in community spaces as well as external channels | ||
like social media. Violating these terms may lead to a temporary or | ||
permanent ban. | ||
|
||
### 3. Temporary Ban | ||
|
||
**Community Impact**: A serious violation of community standards, including | ||
sustained inappropriate behavior. | ||
|
||
**Consequence**: A temporary ban from any sort of interaction or public | ||
communication with the community for a specified period of time. No public or | ||
private interaction with the people involved, including unsolicited interaction | ||
with those enforcing the Code of Conduct, is allowed during this period. | ||
Violating these terms may lead to a permanent ban. | ||
|
||
### 4. Permanent Ban | ||
|
||
**Community Impact**: Demonstrating a pattern of violation of community | ||
standards, including sustained inappropriate behavior, harassment of an | ||
individual, or aggression toward or disparagement of classes of individuals. | ||
|
||
**Consequence**: A permanent ban from any sort of public interaction within | ||
the community. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 2.0, available at | ||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. | ||
|
||
Community Impact Guidelines were inspired by [Mozilla's code of conduct | ||
enforcement ladder](https://github.com/mozilla/diversity). | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see the FAQ at | ||
https://www.contributor-covenant.org/faq. Translations are available at | ||
https://www.contributor-covenant.org/translations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Contributing Guides | ||
|
||
First of all, thank you for your effort to improve this action. This guide will help you regarding various aspects like putting issues, contributing a feature, etc. | ||
|
||
## Code of Conduct | ||
|
||
This project and everyone participating in it is governed by the [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please read the [full text](CODE_OF_CONDUCT.md) so that you can read which actions may or may not be tolerated. | ||
|
||
--- | ||
|
||
## Before Submitting a Pull Request | ||
|
||
**Before submitting your pull request** make sure the following requirements are fulfilled: | ||
|
||
- Fork the repository | ||
- Create a branch from `master` | ||
- Run `npm install` in the repository root | ||
- Change necessary code for bug fix, a new feature | ||
- Check linting and format it | ||
|
||
```bash | ||
npm run lint | ||
npm run format | ||
``` | ||
|
||
- Make sure all are test passing | ||
|
||
```bash | ||
npm run test | ||
``` | ||
|
||
## Reporting an issue | ||
|
||
Before submitting an issue, you need to make sure: | ||
|
||
- Kindly provide an adequate description and a clear title | ||
- If possible, share a URL towards the repository in which action is failing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ jobs: | |
name: A job to automate contrib in readme | ||
steps: | ||
- name: Contribute List | ||
uses: akhilmhdh/[email protected] | ||
uses: akhilmhdh/[email protected].1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
|
@@ -41,15 +41,11 @@ That's it! | |
To add it to your to your existing workflow, append this to your current `.yml` workflow script. | ||
|
||
```yml | ||
- uses: akhilmhdh/[email protected] | ||
- uses: akhilmhdh/[email protected].1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
|
||
> Currently GITHUB_TOKEN doesn't have permission to directly commit on a protected branch. To solve this you may need to replace the github action token with an admin acc token as mentioned in this post by [phips28](https://github.community/t/how-to-push-to-protected-branches-in-a-github-action/16101/10). Hopefully in the future GitHub can give an exception to actions in workflow. | ||
|
||
> Now there is an alternative solution, if your branch is protected or there is status checks. You can set input `is_protected` to `true` in config and the action won't directly commit to the branch. Instead it will put a PR by creating a branch out of the branch that the action is running on. To avoid bloating with lot of branches either delete the branch on merge or set the option in github to delete source branch on merge automatically. | ||
|
||
### Second Step | ||
|
||
1. Add a `README.md` file | ||
|
@@ -126,23 +122,40 @@ You can add these optional parameters in your action script to modify the appear | |
|
||
```yml | ||
- name: Contribute List | ||
uses: akhilmhdh/[email protected] | ||
uses: akhilmhdh/[email protected].1 | ||
with: | ||
image_size: 100 | ||
``` | ||
|
||
| Option | Default Value | Description | Required | | ||
| --------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -------- | | ||
| image_size | 100(px) | Size of square images in the stack | false | | ||
| is_protected | false | If the branch to be updated is protected change this to true to change from directly commiting to PR update | false | | ||
| readme_path | README.md | Path of the readme file you want to update | false | | ||
| use_username | false | To use username instead of full name | false | | ||
| columns_per_row | 6 | Number of columns in a row | false | | ||
| collaborators | direct | Type of collaborators options: all/direct/outside | false | | ||
| commit_message | contrib-readme-action has updated readme | Commit message of the github action | false | | ||
| committer_username | contrib-readme-bot | Username on commit | false | | ||
| committer_email | [email protected] | Email id of committer | false | | ||
| pr_title_on_protected | contributors readme action update | Title of the PR that will be created if the branch is protected | false | | ||
| Option | Default Value | Description | Required | | ||
| --------------------- | ---------------------------------------- | --------------------------------------------------------------- | -------- | | ||
| image_size | 100(px) | Size of square images in the stack | false | | ||
| readme_path | README.md | Path of the readme file you want to update | false | | ||
| use_username | false | To use username instead of full name | false | | ||
| columns_per_row | 6 | Number of columns in a row | false | | ||
| collaborators | direct | Type of collaborators options: all/direct/outside | false | | ||
| commit_message | contrib-readme-action has updated readme | Commit message of the github action | false | | ||
| committer_username | contrib-readme-bot | Username on commit | false | | ||
| committer_email | [email protected] | Email id of committer | false | | ||
| pr_title_on_protected | contributors readme action update | Title of the PR that will be created if the branch is protected | false | | ||
|
||
> The action will update Readme as PR when the branch is protected, else it will directly commit it. | ||
|
||
### Outputs | ||
|
||
Following outputs are generated on the execution of this action. | ||
|
||
| Output | Value | Description | | ||
| ------ | ------ | ------------------------------------------------------------ | | ||
| pr_id | string | Id of the generated PR when the branch is in protected mode. | | ||
|
||
## Contributing | ||
|
||
Please see [CONTRIBUTING.md](/CONTRIBUTING.md) for getting started with the contribution. | ||
|
||
Make sure that you follow [CODE_OF_CONDUCT.md](/CODE_OF_CONDUCT.md) while contributing and engaging in the discussions. | ||
|
||
**When contributing, please first discuss the change you wish to make via an issue on this repository before making the actual change**. | ||
|
||
## License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters