Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@ export default [
version: '18.0',
},
},
rules: {
'import/no-unresolved': [
'error',
{
// because https://github.com/octokit/rest.js/pull/501
ignore: ['^@octokit/graphql$', '^@octokit/rest$'],
},
],
},
},
]
2 changes: 1 addition & 1 deletion functions/classes/AutomergeHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GraphqlResponseError } from '@octokit/graphql'
import semverDiff from 'semver/functions/diff'
import semverDiff from 'semver/functions/diff.js'
import { Handler } from './Handler.js'

export class AutomergeHandler extends Handler {
Expand All @@ -10,10 +10,10 @@
return callback(null, response)
}

console.log(`Working on repo ${body.repository.full_name} for PR #${body.pull_request.number}`)

Check warning on line 13 in functions/classes/AutomergeHandler.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement. Only these console methods are allowed: warn, error

if (!['opened', 'reopened', 'synchronize'].includes(body?.action)) {
console.log(`Wrong action: ${body?.action}`)

Check warning on line 16 in functions/classes/AutomergeHandler.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement. Only these console methods are allowed: warn, error

return callback(null, {
statusCode: 204,
Expand All @@ -22,7 +22,7 @@
}

if (body?.pull_request?.mergeable === false) {
console.log(`PR can't be merged`)

Check warning on line 25 in functions/classes/AutomergeHandler.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement. Only these console methods are allowed: warn, error

return callback(null, {
statusCode: 204,
Expand All @@ -31,7 +31,7 @@
}

if (body?.pull_request?.base?.repo?.allow_auto_merge !== true) {
console.log(

Check warning on line 34 in functions/classes/AutomergeHandler.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement. Only these console methods are allowed: warn, error
`Repo does not allow auto merge: ${body?.pull_request?.base?.repo?.allow_auto_merge}`
)

Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
"devDependencies": {
"@20minutes/eslint-config": "^2.0.0",
"@fetch-mock/jest": "^0.2.20",
"@jest/globals": "^30.2.0",
"eslint": "^9.39.2",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
Expand All @@ -30,12 +29,11 @@
"prettier": "^3.8.1",
"serverless-offline": "^13.9.0",
"serverless-webpack": "^5.15.3",
"webpack": "^5.104.1",
"webpack-node-externals": "^3.0.0"
"webpack": "^5.104.1"
},
"dependencies": {
"@octokit/graphql": "^7.1.1",
"@octokit/rest": "^20.1.2",
"@octokit/graphql": "^9.0.3",
"@octokit/rest": "^22.0.1",
"semver": "^7.7.3",
"source-map-support": "^0.5.21",
"uri-js": "npm:uri-js-replace"
Expand All @@ -44,7 +42,6 @@
"verbose": true,
"clearMocks": true,
"testEnvironment": "node",
"transform": {},
"collectCoverage": true,
"collectCoverageFrom": [
"functions/**/*.js",
Expand Down
2 changes: 1 addition & 1 deletion serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package:
custom:
webpack:
webpackConfig: 'webpack.config.cjs'
includeModules: true
includeModules: false
packager: yarn
excludeRegex: 'node_modules/(@aws-sdk|@aws-crypto|(.+\.(md|JPG|jpg|jpeg)$))|yarn\.lock'

Expand Down
3 changes: 1 addition & 2 deletions webpack.config.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const slsw = require('serverless-webpack')
const nodeExternals = require('webpack-node-externals')

module.exports = {
entry: slsw.lib.entries,
stats: 'minimal',
target: 'node',
devtool: 'source-map',
externals: [nodeExternals()],
externals: [],
mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
}
Loading
Loading