Skip to content

Commit

Permalink
Switch to Node.js 16 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibdex committed Dec 5, 2021
1 parent 33438f9 commit 37def88
Show file tree
Hide file tree
Showing 12 changed files with 1,846 additions and 928 deletions.
50 changes: 0 additions & 50 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on: push
jobs:
Auto:
name: Auto-update
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: tibdex/auto-update@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
jobs:
publish:
name: Publish
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: dylanvann/publish-github-action@v1.1.49
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 8 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ on:
jobs:
test:
name: Test
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Install
run: yarn install --frozen-lockfile
- name: Deduplicate dependencies
run: yarn run yarn-deduplicate --fail
- name: Build
run: yarn run build
- name: ESLint
run: yarn run eslint
- name: Prettier
run: yarn run check-prettier
- name: Format
run: yarn run prettier --check
- name: Lint
run: yarn run xo
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright (c) 2020 Thibault Derousseaux <tibdex@gmail.com>
Copyright (c) 2021 Thibault Derousseaux <tibdex@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
description: Token for the GitHub API.
required: true
runs:
using: node12
using: node16
main: dist/index.js
branding:
icon: refresh-cw
Expand Down
45 changes: 19 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
{
"name": "auto-update",
"version": "2.1.2",
"version": "2.1.3",
"license": "MIT",
"files": [
"action.yml",
"dist"
],
"main": "dist/index.js",
"scripts": {
"build": "ncc build src/index.ts --minify --v8-cache",
"check-prettier": "yarn run prettier --check",
"eslint": "eslint --ignore-path .gitignore --max-warnings 0 \"./**/*.{js,ts}\"",
"format-prettier": "yarn run prettier --write",
"prettier": "prettier --ignore-path .gitignore \"./**/*.{js,json,md,ts,yml}\""
"build": "ncc build src/index.ts --minify --target es2021 --v8-cache",
"prettier": "prettier --ignore-path .gitignore \"./**/*.{cjs,js,json,md,ts,yml}\"",
"xo": "xo"
},
"devDependencies": {
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0",
"@octokit/openapi-types": "^6.0.0",
"@octokit/webhooks-definitions": "^3.67.0",
"@types/node": "^14.14.37",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@vercel/ncc": "^0.27.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-config-xo": "^0.35.0",
"eslint-config-xo-typescript": "^0.38.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-sort-destructure-keys": "^1.3.5",
"eslint-plugin-typescript-sort-keys": "^1.6.0",
"eslint-plugin-unicorn": "^29.0.0",
"prettier": "^2.2.1",
"typescript": "^4.2.3"
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0",
"@octokit/openapi-types": "^11.2.0",
"@octokit/webhooks-definitions": "^3.67.3",
"@types/node": "^16.11.11",
"@vercel/ncc": "^0.33.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
"eslint-plugin-typescript-sort-keys": "^2.1.0",
"prettier": "^2.5.1",
"prettier-plugin-packagejson": "^2.2.15",
"typescript": "^4.5.2",
"xo": "^0.47.0",
"yarn-deduplicate": "^3.1.0"
}
}
File renamed without changes.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
error as logError,
getInput,
info,
group,
info,
error as logError,
setFailed,
warning,
} from "@actions/core";
Expand Down Expand Up @@ -174,6 +174,8 @@ const run = async () => {
);

for (const pullRequest of pullRequests) {
// PRs are handled sequentially to avoid breaking GitHub's log grouping feature.
// eslint-disable-next-line no-await-in-loop
await handlePullRequest(pullRequest, { eventPayload, octokit });
}
} catch (error: unknown) {
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"moduleResolution": "node",
"noEmitOnError": true,
"strict": true,
"target": "esnext",
"target": "es2021",
"types": ["node"]
},
"include": [".*.js", "*.js", "src"]
"include": ["src"]
}
61 changes: 61 additions & 0 deletions xo.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
"use strict";

module.exports = {
extends: ["prettier"],
overrides: [
{
files: "**/*.{ts,tsx}",
rules: {
// Covered by TypeScript.
"default-case": "off",
},
},
],
plugins: ["sort-destructure-keys", "typescript-sort-keys"],
rules: {
// GitHub uses snake_case in its returned payloads.
"@typescript-eslint/naming-convention": "off",
// Forbid function declarations.
"func-style": ["error", "expression", { allowArrowFunctions: true }],
// Already taken care of by TypeScript.
"import/namespace": "off",
// Named export are better for static analysis.
// See https://humanwhocodes.com/blog/2019/01/stop-using-default-exports-javascript-module/
"import/no-default-export": "error",
"import/no-namespace": "error",
"import/order": [
"error",
{
alphabetize: {
caseInsensitive: true,
order: "asc",
},
"newlines-between": "never",
},
],
"no-console": "error",
"object-shorthand": [
"error",
"always",
{ avoidExplicitReturnArrows: true },
],
"sort-destructure-keys/sort-destructure-keys": [
"error",
{
caseSensitive: false,
},
],
"sort-imports": ["error", { ignoreDeclarationSort: true }],
"sort-keys": [
"error",
"asc",
{
caseSensitive: false,
minKeys: 2,
natural: true,
},
],
"typescript-sort-keys/interface": "error",
"typescript-sort-keys/string-enum": "error",
},
};
Loading

0 comments on commit 37def88

Please sign in to comment.