Skip to content

Commit fb9853c

Browse files
authored
Update dependencies (#86)
1 parent 7eb9608 commit fb9853c

File tree

15 files changed

+2146
-1512
lines changed

15 files changed

+2146
-1512
lines changed

.eslintrc.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/autosquash.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/backport.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Backport
22
on:
3-
pull_request:
3+
pull_request_target:
44
types:
55
- closed
66
- labeled
@@ -9,6 +9,20 @@ jobs:
99
backport:
1010
runs-on: ubuntu-18.04
1111
name: Backport
12+
# Only react to merged PRs for security reasons.
13+
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
14+
if: >
15+
github.event.pull_request.merged
16+
&& (
17+
(
18+
github.event.action == 'closed'
19+
&& contains(github.event.pull_request.labels.*.name, 'backport')
20+
)
21+
|| (
22+
github.event.action == 'labeled'
23+
&& contains(github.event.label.name, 'backport')
24+
)
25+
)
1226
steps:
1327
- name: Backport
1428
uses: tibdex/backport@v1

.github/workflows/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ on:
77
jobs:
88
test:
99
name: Test
10-
runs-on: ubuntu-18.04
10+
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v1
1313
- name: Install
1414
run: yarn install --frozen-lockfile
15+
- name: Deduplicate dependencies
16+
run: yarn run yarn-deduplicate --fail
1517
- name: Build
1618
run: yarn run build
17-
- name: ESLint
18-
run: yarn run eslint
19-
- name: Prettier
20-
run: yarn run check-prettier
19+
- name: Format
20+
run: yarn run prettier --check
21+
- name: Lint
22+
run: yarn run xo

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The MIT License (MIT)
2-
Copyright (c) 2020 Thibault Derousseaux <tibdex@gmail.com>
2+
Copyright (c) 2022 Thibault Derousseaux <tibdex@gmail.com>
33

44
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:
55

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ It thus integrates well with [Autosquash](https://github.com/marketplace/actions
88
1. :electric_plug: Add this [.github/workflows/backport.yml](.github/workflows/backport.yml) to your repository.
99

1010
2. :speech_balloon: Let's say you want to backport a pull request on a branch named `production`.
11-
11+
1212
Then label it with `backport production`. (See [how to create labels](https://help.github.com/articles/creating-a-label/).)
1313

1414
3. :sparkles: That's it! When the pull request gets merged, it will be backported to the `production` branch.

action.yml

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,51 @@ name: Backporting
22
author: Thibault Derousseaux <tibdex@gmail.com>
33
description: Automatically backport PRs to other branches by simply labeling them.
44
inputs:
5-
add_labels:
6-
description: Comma separated list of labels to add to the backport PR.
7-
required: false
5+
body_template:
6+
description: >
7+
Lodash template for the backport PR's body.
8+
9+
The data properties are:
10+
- base: backport PR's base branch
11+
- body: original PR's body
12+
- mergeCommitSha: SHA of the original PR's merge commit
13+
- number: original PR's number
14+
default: "Backport <%= mergeCommitSha %> from #<%= number %>"
15+
head_template:
16+
description: >
17+
Lodash template for the backport PR's head branch.
18+
19+
The data properties are:
20+
- base: backport PR's base branch
21+
- number: original PR's number
22+
default: "backport-<%= number %>-to-<%= base %>"
23+
label_pattern:
24+
description: >
25+
The regular expression pattern that PR labels will be tested on to decide whether the PR should be backported and where.
26+
The backport PR's base branch will be extracted from the pattern's required `base` named capturing group.
27+
default: "^backport (?<base>([^ ]+))$"
28+
labels_template:
29+
description: >
30+
Lodash template compiling to a JSON array of labels to add to the backport PR.
31+
32+
The data properties are:
33+
- base: backport PR's base branch
34+
- labels: array containing the original PR's labels
35+
default: "[]"
836
github_token:
937
description: Token for the GitHub API.
1038
required: true
1139
title_template:
12-
description: Template for the title of the backport PR.
13-
required: false
14-
default: "[Backport {{base}}] {{originalTitle}}"
40+
description: >
41+
Lodash template for the backport PR's title.
42+
43+
The data properties are:
44+
- base: backport PR's base branch
45+
- number: original PR's number
46+
- title: original PR's title
47+
default: "[Backport <%= base %>] <%= title %>"
1548
runs:
16-
using: node12
49+
using: node16
1750
main: dist/index.js
1851
branding:
1952
icon: arrow-left-circle

package.json

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
11
{
22
"name": "backport",
3-
"version": "1.1.1",
3+
"version": "2.0.0",
44
"license": "MIT",
5+
"main": "dist/index.js",
56
"files": [
67
"action.yml",
78
"dist"
89
],
9-
"main": "dist/index.js",
1010
"scripts": {
11-
"build": "ncc build src/index.ts --minify --v8-cache",
12-
"check-prettier": "yarn run prettier --check",
13-
"eslint": "eslint --ignore-path .gitignore --max-warnings 0 \"./**/*.{js,ts}\"",
14-
"format-prettier": "yarn run prettier --write",
15-
"prettier": "prettier --ignore-path .gitignore \"./**/*.{js,json,md,ts,yml}\""
11+
"prebuild": "tsc --build",
12+
"build": "ncc build src/index.ts --minify --target es2021 --v8-cache",
13+
"prettier": "prettier --ignore-path .gitignore \"./**/*.{cjs,js,json,md,ts,yml}\"",
14+
"xo": "xo"
15+
},
16+
"dependencies": {
17+
"@actions/core": "^1.6.0",
18+
"@actions/exec": "^1.1.1",
19+
"@actions/github": "^5.0.1",
20+
"ensure-error": "^4.0.0",
21+
"lodash-es": "^4.17.21"
1622
},
1723
"devDependencies": {
18-
"@actions/core": "^1.2.6",
19-
"@actions/exec": "^1.0.4",
20-
"@actions/github": "^4.0.0",
21-
"@octokit/webhooks": "^7.15.1",
22-
"@types/lodash": "^4.14.164",
23-
"@types/node": "^14.14.6",
24-
"@types/promise-retry": "^1.1.3",
25-
"@typescript-eslint/eslint-plugin": "^4.6.0",
26-
"@typescript-eslint/parser": "^4.6.0",
27-
"@vercel/ncc": "^0.24.1",
28-
"eslint": "^7.12.1",
29-
"eslint-config-prettier": "^6.15.0",
30-
"eslint-config-xo": "^0.33.1",
31-
"eslint-config-xo-typescript": "^0.35.0",
32-
"eslint-import-resolver-typescript": "^2.3.0",
33-
"eslint-plugin-import": "^2.22.1",
34-
"eslint-plugin-sort-destructure-keys": "^1.3.5",
35-
"eslint-plugin-typescript-sort-keys": "^1.5.0",
36-
"eslint-plugin-unicorn": "^23.0.0",
37-
"lodash": "^4.17.20",
38-
"prettier": "^2.1.2",
39-
"typescript": "^4.0.5"
24+
"@octokit/webhooks-types": "^5.5.1",
25+
"@types/error-cause": "^1.0.1",
26+
"@types/lodash-es": "^4.17.6",
27+
"@types/node": "^16.11.26",
28+
"@vercel/ncc": "^0.33.3",
29+
"eslint-config-prettier": "^8.5.0",
30+
"eslint-plugin-import": "^2.26.0",
31+
"eslint-plugin-sort-destructure-keys": "^1.4.0",
32+
"eslint-plugin-typescript-sort-keys": "^2.1.0",
33+
"prettier": "^2.6.2",
34+
"prettier-plugin-packagejson": "^2.2.17",
35+
"typescript": "^4.6.3",
36+
"xo": "^0.48.0",
37+
"yarn-deduplicate": "^4.0.0"
4038
}
4139
}
File renamed without changes.

0 commit comments

Comments
 (0)