Skip to content

Commit e30fbaa

Browse files
add checks and templates
1 parent 6d188e5 commit e30fbaa

File tree

10 files changed

+367
-0
lines changed

10 files changed

+367
-0
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for
6+
everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity
7+
and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion,
8+
or sexual identity and orientation.
9+
10+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to a positive environment for our community include:
15+
16+
* Demonstrating empathy and kindness toward other people
17+
* Being respectful of differing opinions, viewpoints, and experiences
18+
* Giving and gracefully accepting constructive feedback
19+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
20+
* Focusing on what is best not just for us as individuals, but for the overall community
21+
22+
Examples of unacceptable behavior include:
23+
24+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
25+
* Trolling, insulting or derogatory comments, and personal or political attacks
26+
* Public or private harassment
27+
* Publishing others' private information, such as a physical or email address, without their explicit permission
28+
* Other conduct which could reasonably be considered inappropriate in a professional setting
29+
30+
## Enforcement Responsibilities
31+
32+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take
33+
appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive,
34+
or harmful.
35+
36+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
37+
issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for
38+
moderation decisions when appropriate.
39+
40+
## Scope
41+
42+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
43+
the community in public spaces. Examples of representing our community include using an official e-mail address, posting
44+
via an official social media account, or acting as an appointed representative at an online or offline event.
45+
46+
## Enforcement
47+
48+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible
49+
for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly.
50+
51+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
52+
53+
## Enforcement Guidelines
54+
55+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem
56+
in violation of this Code of Conduct:
57+
58+
### 1. Correction
59+
60+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the
61+
community.
62+
63+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation
64+
and an explanation of why the behavior was inappropriate. A public apology may be requested.
65+
66+
### 2. Warning
67+
68+
**Community Impact**: A violation through a single incident or series of actions.
69+
70+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including
71+
unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding
72+
interactions in community spaces as well as external channels like social media. Violating these terms may lead to a
73+
temporary or permanent ban.
74+
75+
### 3. Temporary Ban
76+
77+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
78+
79+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified
80+
period of time. No public or private interaction with the people involved, including unsolicited interaction with those
81+
enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
82+
83+
### 4. Permanent Ban
84+
85+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate
86+
behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
87+
88+
**Consequence**: A permanent ban from any sort of public interaction within the community.
89+
90+
## Attribution
91+
92+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at
93+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
94+
95+
Community Impact Guidelines were inspired
96+
by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
97+
98+
[homepage]: https://www.contributor-covenant.org
99+
100+
For answers to common questions about this code of conduct, see the FAQ at
101+
https://www.contributor-covenant.org/faq. Translations are available at
102+
https://www.contributor-covenant.org/translations.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug reports
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: [bug]
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
<!-- A clear and concise description of what the bug is.-->
12+
13+
**Expected behavior**
14+
<!-- A clear and concise description of what you expected to happen.-->
15+
16+
**To Reproduce**
17+
<!--
18+
Steps to reproduce the behavior:
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. Scroll down to '....'
22+
4. See error
23+
-->
24+
25+
**Screenshots**
26+
<!-- If applicable, add screenshots to help explain your problem.-->
27+
28+
29+
**Additional context**
30+
<!-- Add any other context about the problem here. -->
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Feature Request
2+
description: Request a new feature
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |-
7+
Please join the [Discord Server](https://discord.gg/tDgMMq6Ysr) for questions or ask them in [our Discussions](https://github.com/Programming-Org/Programming/discussions).
8+
9+
Keep in mind that this isn't the place to learn Java.
10+
Please head over to [StackOverflow](https://stackoverflow.com/questions/tagged/java) for your general programming questions.
11+
- type: checkboxes
12+
attributes:
13+
label: General Troubleshooting
14+
description: You confirm to have made the following checks first.
15+
options:
16+
- label: I have checked for similar issues on the Issue-tracker.
17+
required: true
18+
- label: I have checked the branches or the maintainers' PRs for upcoming features.
19+
required: true
20+
- type: textarea
21+
attributes:
22+
label: "Feature Request"
23+
description: "Provide a small description of the feature you want to have added."
24+
placeholder: "The feature you want to have added is..."
25+
validations:
26+
required: true
27+
- type: textarea
28+
attributes:
29+
label: "Example Use-Case"
30+
description: |-
31+
Provide some code or describe a possible use-case for this feature.
32+
33+
The provided text will be rendered as Java code, so you don't have to provide a Code block for it.
34+
placeholder: "public void newAwesomeMethod(){}"
35+
render: java
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[contributing]: https://github.com/Together-Java/TJ-Bot/wiki/Contributing
2+
[code_guidelines]: https://github.com/Together-Java/TJ-Bot/wiki/Code-Guidelines
3+
[new_issue]: https://github.com/Together-Java/TJ-Bot/issues/new/choose
4+
5+
## Pull-request
6+
7+
- [ ] I have read the [contributing guidelines][contributing].
8+
- [ ] I have read the [code guidelines][code_guidelines].
9+
- [ ] I have created a relating [issue][new_issue].
10+
11+
### Changes
12+
13+
- [ ] Existing code
14+
- [ ] New feature
15+
16+
<!--
17+
While an issue isn't required, this is preferred for most changes.
18+
It helps make it maintainable for us, and will save you from possibly recoding everything :p
19+
If there's no relating issue, keep it NaN
20+
-->
21+
22+
Closes Issue: NaN
23+
24+
## Description
25+
26+
Replace this sentence with general description of what your Pull Request does.

.github/workflows/auto-assign.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Auto Assign
2+
on:
3+
issues:
4+
types: [opened]
5+
pull_request:
6+
types: [opened]
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: bubkoo/auto-assign@v1
12+
with:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
CONFIG_FILE: .github/auto-assign.yml

.github/workflows/basic-checks.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Basic checks
2+
3+
on: [pull_request]
4+
5+
env:
6+
JAVA_VERSION: 17
7+
DISTRIBUTION: adopt
8+
9+
jobs:
10+
spotless:
11+
name: "Spotless"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up JDK
15+
uses: actions/setup-java@v3
16+
with:
17+
distribution: ${{ env.DISTRIBUTION }}
18+
java-version: ${{ env.JAVA_VERSION }}
19+
- uses: actions/checkout@v3
20+
- name: Check
21+
run: ./gradlew spotlessCheck
22+
23+
gradle-test:
24+
name: "Gradle Test"
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Set up JDK
28+
uses: actions/setup-java@v3
29+
with:
30+
distribution: ${{ env.DISTRIBUTION }}
31+
java-version: ${{ env.JAVA_VERSION }}
32+
- uses: actions/checkout@v3
33+
- name: Check
34+
run: ./gradlew test
35+
36+
sonarlint:
37+
name: "Sonarlint"
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Set up JDK
41+
uses: actions/setup-java@v3
42+
with:
43+
distribution: ${{ env.DISTRIBUTION }}
44+
java-version: ${{ env.JAVA_VERSION }}
45+
- uses: actions/checkout@v3
46+
with:
47+
fetch-depth: 2
48+
- name: Check
49+
run: ./gradlew sonarlintMain

.github/workflows/gradle.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Java CI
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v3
20+
with:
21+
java-version: '17'
22+
distribution: 'adopt'
23+
- name: Validate Gradle wrapper
24+
uses: gradle/wrapper-validation-action@859c33240bd026ce8d5f711f5adcc65c2f8eafc1
25+
- name: Build with Gradle
26+
uses: gradle/gradle-build-action@992ccebeea5b9d410b9429b47ae411e22297daa7
27+
with:
28+
arguments: build
29+
- uses: actions/upload-artifact@v3
30+
with:
31+
name: YusufModerationBot
32+
path: build/libs
33+

.github/workflows/greetings.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Greetings
2+
3+
on: [pull_request, issues]
4+
5+
jobs:
6+
greeting:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
steps:
12+
- uses: actions/first-interaction@v1
13+
with:
14+
repo-token: ${{ secrets.GITHUB_TOKEN }}
15+
issue-message: 'Hi/Hello Thank you for raising your first issue. Please make sure it is detailed so we know what it is about.'
16+
pr-message: 'Hi/Hello thank you for contributing to this project. Can you please run ./gradlew spotlessApply to make sure the code is tidy and clean. Thank you'

.github/workflows/releases.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release JAR
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
env:
13+
JAVA_VERSION: 17
14+
15+
jobs:
16+
release:
17+
name: Build and release
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Set up JDK
21+
uses: actions/setup-java@v3
22+
with:
23+
java-version: ${{ env.JAVA_VERSION }}
24+
distribution: 'adopt'
25+
- uses: actions/checkout@v3
26+
- name: Build shadow jar
27+
run: ./gradlew shadowJar
28+
- name: Create release
29+
uses: softprops/action-gh-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
32+
with:
33+
files: build/libs/ydw.jar

.github/workflows/stale.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2+
#
3+
# You can adjust the behavior by modifying this file.
4+
# For more information, see:
5+
# https://github.com/actions/stale
6+
name: Mark stale issues and pull requests
7+
8+
on:
9+
schedule:
10+
- cron: '0 7 * * *'
11+
12+
jobs:
13+
stale:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
20+
steps:
21+
- uses: actions/stale@v5
22+
with:
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
stale-issue-message: 'This issue is stale because it has been open 40 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
25+
stale-pr-message: 'This pull request is stale because it has been open 40 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
26+
close-issue-label: 'inactivity-closed'
27+
close-pr-label: 'inactivity-closed'
28+
days-before-stale: 40
29+
days-before-close: 5

0 commit comments

Comments
 (0)