Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
7a13368
style: styling indent space
Muunatic Aug 2, 2023
9688068
chore: change repository path
Muunatic Aug 2, 2023
c0682cb
Merge PR #19 chore: change repository path
typeslint-cli[bot] Aug 2, 2023
5c1f8e2
feat: allow member to merge pull requests
Muunatic Aug 7, 2023
e885845
Merge PR #20 feat: allow member to merge pull requests
typeslint-cli[bot] Aug 7, 2023
886126d
chore: Adjust label for proper case sensitivity
HarunamiYaki Aug 20, 2023
7370a59
Merge PR #21 chore: Adjust label for proper case sensitivity
typeslint-cli[bot] Aug 21, 2023
094d5c6
feat: implement automated stale label for inactive pull requests
Muunatic Aug 22, 2023
93c117e
chore: remove unused method
Muunatic Aug 22, 2023
de1bd6d
chore: correct label assignment
Muunatic Aug 22, 2023
7e2a588
Merge PR #22 feat: implement automated stale label for inactive pull …
typeslint-cli[bot] Aug 22, 2023
ccbf57a
fix: fix stale statement condition
Muunatic Aug 24, 2023
5514aa4
Merge PR #23 fix: fix stale statement condition
typeslint-cli[bot] Aug 24, 2023
d606dde
feat: implement pull request mergeability check
Muunatic Aug 28, 2023
0f8e0d6
Merge PR #25 feat: implement pull request mergeability check
typeslint-cli[bot] Aug 28, 2023
8644d8c
refactor: avoid no-misused-promises
Muunatic Sep 18, 2023
60622c1
Merge PR #26 refactor: avoid no-misused-promises
typeslint-cli[bot] Sep 19, 2023
f59e0c3
chore: Add error interface
HarunamiYaki Sep 29, 2023
f1fbb39
Merge PR #27 refactor: Add error interface
typeslint-cli[bot] Sep 29, 2023
c5c20b0
chore: Adjust reply context
HarunamiYaki Oct 8, 2023
abfcf6a
Merge PR #28 chore: Adjust reply context
typeslint-cli[bot] Oct 9, 2023
ab06dae
build(CI): update node and npm version
Muunatic Oct 9, 2023
ba4914f
Merge PR #29 build(CI): update node and npm version
typeslint-cli[bot] Oct 10, 2023
c286de9
test(linter): extends recommended-type-checked and add linter rules
Muunatic Oct 13, 2023
aef2818
Merge PR #30 test(linter): extends recommended-type-checked and add l…
typeslint-cli[bot] Oct 13, 2023
d142950
fix: Add reply outside core dir
HarunamiYaki Oct 15, 2023
e79ea2c
Merge PR #31 fix: Add reply outside core dir
typeslint-cli[bot] Oct 16, 2023
ffc6334
chore(tsconfig): add pretty to compilerOptions
Muunatic Oct 23, 2023
90a33a5
Merge PR #32 chore(tsconfig): add pretty to compilerOptions
typeslint-cli[bot] Oct 24, 2023
43e3a05
docs: change author name
Muunatic Oct 26, 2023
8a1c8a6
Merge PR #35 docs: change author name
typeslint-cli[bot] Oct 27, 2023
4080d96
chore: ignore dist directory
Muunatic Oct 31, 2023
d50a43c
Merge PR #36 chore: ignore dist directory
typeslint-cli[bot] Oct 31, 2023
948283c
build(DOCKERFILE): change run script
Muunatic Nov 3, 2023
07d901f
feat(API)!: Replace fetch with Node.js 18 module
HarunamiYaki Nov 3, 2023
8b6ae3f
Merge PR #37 build(DOCKERFILE): change run script
typeslint-cli[bot] Nov 3, 2023
e18e222
Merge PR #38 feat(API)!: Replace fetch with Node.js 18 module
typeslint-cli[bot] Nov 3, 2023
e34cc4e
style: change quotes to double quote
Muunatic Nov 6, 2023
52f19b5
chore: remove unused node-fetch
Muunatic Nov 6, 2023
ffcfc50
style: adjust quotes for the context body
Muunatic Nov 6, 2023
94b6bb8
Merge PR #39 style: change quotes to double quote
typeslint-cli[bot] Nov 6, 2023
a9931d4
test(linter): add quotes rules
Muunatic Nov 9, 2023
35335c3
Merge PR #40 test(linter): add quotes rules
typeslint-cli[bot] Nov 10, 2023
cf636e0
feat: create core class
Muunatic Nov 13, 2023
3a586bf
feat: create constant to export class
Muunatic Nov 13, 2023
4a1e777
refactor: change interface to type
Muunatic Nov 13, 2023
5adea3f
feat: export Context as default
Muunatic Nov 13, 2023
0c11a6c
Merge PR #42 feat(app): create core class
typeslint-cli[bot] Nov 13, 2023
c1aeff6
test(linter) add no-unnecessary-condition and sort-imports rules
Muunatic Nov 16, 2023
e262f2e
Merge PR #43 test(linter) add no-unnecessary-condition and sort-impor…
typeslint-cli[bot] Nov 16, 2023
e966f4f
build(CI): add build CI and update node version
Muunatic Nov 17, 2023
d400dd8
Merge PR #44 build(CI): add build CI and update node version
typeslint-cli[bot] Nov 17, 2023
5164829
style: change to checkUserCI
Muunatic Nov 20, 2023
87ad7bc
fix: inaccessible pull_request number in workflow_run
Muunatic Nov 20, 2023
ac81168
refactor: get pull request number by head_sha
Muunatic Nov 22, 2023
10ccbc2
fix: add missing parentheses to iife
Muunatic Nov 29, 2023
1174031
Merge PR #47 fix: add missing parentheses to iife
typeslint-cli[bot] Dec 1, 2023
50e1ebe
Merge PR #45 fix: inaccessible pull_request number in workflow_run
typeslint-cli[bot] Dec 5, 2023
79f122c
docs: update contributing guide
Muunatic Dec 5, 2023
dcf72e6
Merge PR #48 docs: update contribution guide
typeslint-cli[bot] Dec 6, 2023
c852d01
fix: cast 'head_sha' as string
Muunatic Dec 11, 2023
6adf29b
Merge PR #49 fix: cast 'head_sha' as string
typeslint-cli[bot] Dec 13, 2023
ecc7bda
refactor: get content changes instead of additions
Muunatic Dec 14, 2023
a44f877
docs(README): Adjust README documentation
HarunamiYaki Dec 17, 2023
cefa85d
Merge PR #50 refactor: get content changes instead of additions
typeslint-cli[bot] Dec 18, 2023
0db5b67
Merge PR #51 docs(README): Adjust README documentation
typeslint-cli[bot] Dec 18, 2023
32415f5
build(CI): update node version and npm version
Muunatic Dec 26, 2023
c967802
Merge PR #52 build(CI): update node version and npm version
typeslint-cli[bot] Dec 28, 2023
5283b47
refactor: using curly bracket on conditional
Muunatic Dec 28, 2023
7d26681
Merge PR #53 refactor: using curly bracket on conditional
typeslint-cli[bot] Dec 28, 2023
05ac167
style: no multi spaces and add newlines between class members
Muunatic Dec 29, 2023
29c0be4
test(linter) add lines-between-class-members, no-multi-spaces, no-mul…
Muunatic Dec 29, 2023
72b6229
docs: Create security policy
HarunamiYaki Dec 29, 2023
2d8fa8d
chore: Create PULL_REQUEST_TEMPLATE.md
HarunamiYaki Dec 29, 2023
510ca60
chore: Create Issues.yml for ISSUE_TEMPLATE
HarunamiYaki Dec 29, 2023
e49755f
Merge PR #55 test(linter) add lines-between-class-members, no-multi-s…
typeslint-cli[bot] Dec 29, 2023
8b10fbd
Merge PR #56 chore: Add Security Policy, Templates, and Issue Standar…
typeslint-cli[bot] Dec 29, 2023
8bfcd29
Merge PR #54 style: remove multi spaces and add newlines between clas…
typeslint-cli[bot] Dec 29, 2023
644309a
chore(release): 3.0.0 Release
Muunatic Dec 29, 2023
f6efa58
Merge PR #57 chore(release): 3.0.0 Release
typeslint-cli[bot] Dec 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 54 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,67 @@
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-type-checked"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
"sourceType": "module",
"project": true
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"eol-last": ["warn", "always"],
"semi-style": ["warn", "last"],
"semi": 2,
"brace-style": ["warn", "1tbs"],
"camelcase": ["warn", {
"properties": "never",
"ignoreImports": true
}],
"comma-dangle": ["error", "never"],
"comma-spacing": ["warn", {
"after": true,
"before": false
}],
"comma-style": ["warn", "last"],
"no-unused-vars": 1,
"curly": ["error", "all"],
"default-case": 1,
"eol-last": ["warn", "always"],
"indent": ["warn", 4, {
"SwitchCase": 1
}],
"key-spacing": ["warn", {
"mode": "strict"
}],
"keyword-spacing": ["warn", {
"after": true,
"before": true
}],
"lines-between-class-members": ["warn", "always"],
"no-multi-spaces": 1,
"no-multiple-empty-lines": ["warn", {
"max": 1
}],
"no-trailing-spaces": 1,
"no-unused-vars": 1,
"no-useless-escape": 0,
"@typescript-eslint/no-require-imports": 2,
"@typescript-eslint/no-var-requires": 0,
"object-curly-spacing": ["error", "always", {
"objectsInObjects": true,
"arraysInObjects": true
}],
"quotes": ["warn", "double", {
"avoidEscape": false
}],
"semi": "error",
"semi-style": ["warn", "last"],
"sort-imports": ["warn", {
"ignoreCase": false,
"ignoreDeclarationSort": true
}],
"@typescript-eslint/explicit-function-return-type": ["warn", {
"allowExpressions": true
}],
"@typescript-eslint/member-delimiter-style": ["warn", {
"multiline": {
"delimiter": "semi",
Expand All @@ -36,6 +76,10 @@
"requireLast": false
},
"multilineDetection": "brackets"
}]
}
}],
"@typescript-eslint/no-unnecessary-condition": 2,
"@typescript-eslint/no-require-imports": 2,
"@typescript-eslint/no-var-requires": 1
},
"ignorePatterns": ["dist/*.js", "dist/**/*.js"]
}
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/Issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Bug Report"
description: "Report a bug encountered while using the project."
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Welcome to the issue tracker!

Before submitting your issue, please make sure to provide as much relevant information as possible.

- type: input
attributes:
label: Issue Description
description: Provide a brief description of the issue you are facing.

- type: input
attributes:
label: Expected Behavior
description: What should happen?

- type: input
attributes:
label: Actual Behavior
description: What is happening instead?

- type: textarea
attributes:
label: Steps to Reproduce
description: Describe the steps required to reproduce the issue, including code snippets, if relevant.

- type: input
attributes:
label: NodeJS Environment
description: NodeJS Version

- type: input
attributes:
label: Package Manager
description: NPM Version

- type: dropdown
attributes:
label: Operating System
options:
- Windows
- macOS
- Linux
validations:
required: true
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Changes
<!---Describe what changes this PR includes-->

26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run TypeScript Compiler

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
lint:
runs-on: windows-latest
strategy:
matrix:
node-version: [18.19.0]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install npm
run: npm install npm@10.2.3 -g
- name: Install dependencies
run: npm ci
- name: Run typescript compiler
run: npm run build --if-present
18 changes: 9 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: eslint
name: Run ESLint Linter

on:
push:
branches: [ main ]
branches: [ develop ]
pull_request:
branches: [ main ]
branches: [ develop ]

jobs:
lint:
runs-on: windows-latest
strategy:
matrix:
node-version: [16.19.0]
node-version: [18.19.0]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: install npm
run: npm install npm@8.19.3 -g
- name: install dependencies
- name: Install npm
run: npm install npm@10.2.3 -g
- name: Install dependencies
run: npm ci
- name: run lint
run: npm run lint
- name: Run lint
run: npm run lint --if-present
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ npm-debug.log
.env
coverage
lib
dist
73 changes: 47 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,60 @@
## Contributing
# Contribution Guide

[fork]: /fork
[pr]: /compare
[code-of-conduct]: CODE_OF_CONDUCT.md
Welcome to the contribution guide! I appreciate your interest in contributing to github-AutoResponse project. This guide will provide you with the necessary information and guidelines to make your contributions valuable and effective.

Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
### 1. Getting started

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.
Contributions can come in various forms, including bug fixes, refactoring the code, documentation improvements, and more. Here are some ways you can contribute to the repository:

## Issues and PRs
- Fix bugs and address issues.
- Refactor code for better maintainability.
- Improve the documentation.

If you have suggestions for how this project could be improved, or want to report a bug, open an issue! We'd love all and any contributions. If you have questions, too, we'd love to hear them.
If you're unsure about what to work on, you can check the repository's issue tracker for any open issues.

We'd also love PRs. If you're thinking of a large PR, we advise opening up an issue first to talk about it, though! Look at the links below if you're not sure how to open a PR.
### 2. Code Style and Guidelines

## Submitting a pull request
To maintain a consistent codebase, this project follow certain code style and guidelines. Please adhere to the following conventions when contributing code:

1. [Fork][fork] and clone the repository.
1. Configure and install the dependencies: `npm install`.
1. Make sure the tests pass on your machine: `npm test`, note: these tests also apply the linter, so there's no need to lint separately.
1. Create a new branch: `git checkout -b my-branch-name`.
1. Make your change, add tests, and make sure the tests still pass.
1. Push to your fork and [submit a pull request][pr].
1. Pat your self on the back and wait for your pull request to be reviewed and merged.
- Follow the code standard and writing style from ESLint config.
- Use camelcase for variable, function, etc.
- Write clear and concise comments when necessary (will remove after merging).

Here are a few things you can do that will increase the likelihood of your pull request being accepted:
### 3. Running the Linter

- Write and update tests.
- Keep your changes 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.
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
This repository have a linter set up for the project to ensure consistent code style and catch potential issues. Before opening a pull request, please run the following command to execute the linter and fix any reported issues:

Work in Progress pull requests are also welcome to get feedback early on, or if there is something blocked you.
```
npm run lint
```

## Resources
Make sure the linter passes without any errors or warnings before proceeding with your pull request. This step ensures that the codebase remains clean and consistent.

- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
- [GitHub Help](https://help.github.com)
### 4. Using Conventional Commits

To have a consistent commit message format across the repository, we follow the Conventional Commits specification. Please use the following format for your commit messages:

```
<type>[optional scope]: <description>
```

Here's an example of a conventional commit message:

```
feat(core): add issue_comment.created event
```

For more information about the Conventional Commits specification, you can refer to [conventionalcommits.org](https://conventionalcommits.org).

### 5. Avoiding Copyright Infringement

When contributing code or any other content, it's important to ensure that your contributions are your own original creation and do not violate any copyright laws or infringe upon the intellectual property rights of others. By contributing to this repository, you agree to the following:

- You warrant that the contribution is your original work.
- You agree to grant the repository maintainers and users a license to use your contributions under the repository's designated license. [LICENSE](https://github.com/Typeslint/github-AutoResponse/blob/main/LICENSE)

Please refrain from including any code, documentation, or other content in your contributions that may have been copied or derived from copyrighted sources without the necessary permissions or licenses.

### 6. LICENSE

By contributing to this repository, you agree that your contributions will be licensed under the same license as the repository itself. Please refer to the repository's [LICENSE](https://github.com/Typeslint/github-AutoResponse/blob/main/LICENSE) file for more details.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:18
WORKDIR /usr/src/app
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --production
RUN npm ci
RUN npm cache clean --force
ENV NODE_ENV="production"
COPY . .
CMD [ "npm", "start" ]
CMD [ "npm", "run", "build:start" ]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2021, Muunatic <125534A11B63B1FC>
Copyright (c) 2021, Typeslint <support@typeslint.com>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
44 changes: 19 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
# GitHub-AutoResponse
# github-AutoResponse
This GitHub Automaton is a Probot-based application that automates various actions and responses to different events within a GitHub repository. It utilizes Probot, Octokit, and various event listeners to handle actions such as closing issues, commenting on issues and pull requests, managing pull requests, and performing checks on workflow runs.

> A GitHub App built with [Probot](https://github.com/probot/probot) framework
## Features
- Push Event Handling: Responds to push events in the repository.
- Issues Management: Handles opening, closing, and commenting on issues.
- Pull Request Management: Manages opening, reviewing, and synchronizing pull requests.
- Workflow Run Handling: Performs checks based on workflow run completion events.
- Stale Pull Requests: Regularly checks for stale pull requests.

## Setup
## Configuration
Environment Variables
To use this application, set the following environment variables in a .env file:

```sh
# Install dependencies
npm install
APP_ID: Your GitHub App's ID.
PRIVATE_KEY: Your GitHub App's private key.
CLIENT_ID: Your GitHub App's client ID.
CLIENT_SECRET: Your GitHub App's client secret.

# Run the client
npm start
```

## Docker

```sh
# 1. Build container
docker build -t my-first-app .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> my-first-app
```
## Usage
To use this application, install the dependencies and configure the environment variables. Run the application using the appropriate command `npm run build:start`.

## Contributing

If you have suggestions for GitHub-AutoResponse could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the [Contributing Guide](CONTRIBUTING.md).
Contributions are welcome! Please see this <a href="https://github.com/Typeslint/github-AutoResponse/blob/main/CONTRIBUTING.md">**Contribution Guide**</a> and adhere to <a href="https://github.com/Typeslint/github-AutoResponse/blob/main/CODE_OF_CONDUCT.md">**Code Of Conduct**</a>. If you have any improvements, feel free to submit a pull request.

## License

[ISC](LICENSE) © 2021 Muunatic
This project is licensed under the MIT License.
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Policy

## Reporting a Vulnerability

To report a security vulnerability, please send an email to [support@typeslint.com](mailto:support@typeslint.com)
Loading