Skip to content

Commit

Permalink
Update dependencies (tibdex#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibdex authored Apr 9, 2022
1 parent 7eb9608 commit fb9853c
Show file tree
Hide file tree
Showing 15 changed files with 2,146 additions and 1,512 deletions.
55 changes: 0 additions & 55 deletions .eslintrc.js

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/autosquash.yml

This file was deleted.

16 changes: 15 additions & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Backport
on:
pull_request:
pull_request_target:
types:
- closed
- labeled
Expand All @@ -9,6 +9,20 @@ jobs:
backport:
runs-on: ubuntu-18.04
name: Backport
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
(
github.event.action == 'closed'
&& contains(github.event.pull_request.labels.*.name, 'backport')
)
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- name: Backport
uses: tibdex/backport@v1
Expand Down
12 changes: 7 additions & 5 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
- 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) 2022 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It thus integrates well with [Autosquash](https://github.com/marketplace/actions
1. :electric_plug: Add this [.github/workflows/backport.yml](.github/workflows/backport.yml) to your repository.

2. :speech_balloon: Let's say you want to backport a pull request on a branch named `production`.

Then label it with `backport production`. (See [how to create labels](https://help.github.com/articles/creating-a-label/).)

3. :sparkles: That's it! When the pull request gets merged, it will be backported to the `production` branch.
Expand Down
47 changes: 40 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,51 @@ name: Backporting
author: Thibault Derousseaux <tibdex@gmail.com>
description: Automatically backport PRs to other branches by simply labeling them.
inputs:
add_labels:
description: Comma separated list of labels to add to the backport PR.
required: false
body_template:
description: >
Lodash template for the backport PR's body.
The data properties are:
- base: backport PR's base branch
- body: original PR's body
- mergeCommitSha: SHA of the original PR's merge commit
- number: original PR's number
default: "Backport <%= mergeCommitSha %> from #<%= number %>"
head_template:
description: >
Lodash template for the backport PR's head branch.
The data properties are:
- base: backport PR's base branch
- number: original PR's number
default: "backport-<%= number %>-to-<%= base %>"
label_pattern:
description: >
The regular expression pattern that PR labels will be tested on to decide whether the PR should be backported and where.
The backport PR's base branch will be extracted from the pattern's required `base` named capturing group.
default: "^backport (?<base>([^ ]+))$"
labels_template:
description: >
Lodash template compiling to a JSON array of labels to add to the backport PR.
The data properties are:
- base: backport PR's base branch
- labels: array containing the original PR's labels
default: "[]"
github_token:
description: Token for the GitHub API.
required: true
title_template:
description: Template for the title of the backport PR.
required: false
default: "[Backport {{base}}] {{originalTitle}}"
description: >
Lodash template for the backport PR's title.
The data properties are:
- base: backport PR's base branch
- number: original PR's number
- title: original PR's title
default: "[Backport <%= base %>] <%= title %>"
runs:
using: node12
using: node16
main: dist/index.js
branding:
icon: arrow-left-circle
Expand Down
56 changes: 27 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
{
"name": "backport",
"version": "1.1.1",
"version": "2.0.0",
"license": "MIT",
"main": "dist/index.js",
"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}\""
"prebuild": "tsc --build",
"build": "ncc build src/index.ts --minify --target es2021 --v8-cache",
"prettier": "prettier --ignore-path .gitignore \"./**/*.{cjs,js,json,md,ts,yml}\"",
"xo": "xo"
},
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.0.1",
"ensure-error": "^4.0.0",
"lodash-es": "^4.17.21"
},
"devDependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.4",
"@actions/github": "^4.0.0",
"@octokit/webhooks": "^7.15.1",
"@types/lodash": "^4.14.164",
"@types/node": "^14.14.6",
"@types/promise-retry": "^1.1.3",
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"@vercel/ncc": "^0.24.1",
"eslint": "^7.12.1",
"eslint-config-prettier": "^6.15.0",
"eslint-config-xo": "^0.33.1",
"eslint-config-xo-typescript": "^0.35.0",
"eslint-import-resolver-typescript": "^2.3.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-sort-destructure-keys": "^1.3.5",
"eslint-plugin-typescript-sort-keys": "^1.5.0",
"eslint-plugin-unicorn": "^23.0.0",
"lodash": "^4.17.20",
"prettier": "^2.1.2",
"typescript": "^4.0.5"
"@octokit/webhooks-types": "^5.5.1",
"@types/error-cause": "^1.0.1",
"@types/lodash-es": "^4.17.6",
"@types/node": "^16.11.26",
"@vercel/ncc": "^0.33.3",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
"eslint-plugin-typescript-sort-keys": "^2.1.0",
"prettier": "^2.6.2",
"prettier-plugin-packagejson": "^2.2.17",
"typescript": "^4.6.3",
"xo": "^0.48.0",
"yarn-deduplicate": "^4.0.0"
}
}
File renamed without changes.
Loading

0 comments on commit fb9853c

Please sign in to comment.