Skip to content

Commit

Permalink
feat(bot): initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart committed Aug 27, 2021
1 parent 98a39a6 commit 1eeeae9
Show file tree
Hide file tree
Showing 20 changed files with 11,508 additions and 105 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
lib/
node_modules/
jest.config.js
**/*.js
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",

plugins: ["@typescript-eslint"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
parserOptions: {
sourceType: "module",
project: "./tsconfig.json",
},
};
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
21 changes: 21 additions & 0 deletions .github/workflows/release-starter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "build-test"
on:
push:
branches: [main]

jobs:
build:
environment: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build & test
run: |
npm ci
npm run all
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx semantic-release
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "build-test"
on: # rebuild any PRs and main branch changes
pull_request:

jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm install
- run: |
npm run all
106 changes: 3 additions & 103 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,104 +1,4 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
node_modules
lib
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
**/*.tsbuildinfo
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @coveo/dx
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# merge-bot
A npx package to use in GitHub Action to merge PR in place of contributors
# Merge Bot Action

The Merge Bot Action does one thing: it tries to merge a PR when asked to. It'll act as a non-priviliged user, meaning that if the PR does not satisifies the protection of the destination branch, it'll fail.

__ReadMe yet ToDo...__
8 changes: 8 additions & 0 deletions __tests__/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
root: true,
extends: "../eslintrc.js",
parserOptions: {
sourceType: "module",
project: "./tsconfig.json",
},
};
16 changes: 16 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
describe("when a PR is created", () => {
it.todo("should create the initial comment");
});

describe("when the checkbox is ticked", () => {
it.todo("should delete the comment if the checkbox is now ticked");
it.todo("should try to merge the PR");
describe("if the merge is succesful", () => {
it.todo("should do nothing more");
});
describe("if the merge is unsuccesful", () => {
it.todo(
"should comment the reason why and ping the person that ticked the checkbox"
);
});
});
11 changes: 11 additions & 0 deletions __tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"composite": true,
"target": "es6",
"module": "commonjs",
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"types": ["jest"]
}
}
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.ts$': 'ts-jest'
},
verbose: true
}
Loading

0 comments on commit 1eeeae9

Please sign in to comment.