Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbf207a670 | ||
|
|
234011c0f7 | ||
|
|
a536a7f5fc | ||
|
|
951eefe413 | ||
|
|
d7568d6287 | ||
|
|
a837bd27d9 | ||
|
|
9986de0edd | ||
|
|
a51640c51f | ||
|
|
d1d225c38f | ||
|
|
a26f63b0ce | ||
|
|
a71372f9dd | ||
|
|
7bdc8af1b2 | ||
|
|
5c9f1f7cef | ||
|
|
d84d80e417 | ||
|
|
4d73263e3e | ||
|
|
b8f7f0eada | ||
|
|
75a30a545a | ||
|
|
401756f9f0 | ||
|
|
21ed6afecd | ||
|
|
388ce4f475 | ||
|
|
a2ca498476 | ||
|
|
60e7d47c17 | ||
|
|
4215dc951b | ||
|
|
33836ed288 | ||
|
|
6fcd798e4a | ||
|
|
50a62d9e15 | ||
|
|
9e04524704 | ||
|
|
6f812a4e2c | ||
|
|
f11ed1f3d2 | ||
|
|
ab2f7e88a9 | ||
|
|
7209b6038a | ||
|
|
b17846f438 | ||
|
|
da58dc8f9a | ||
|
|
4e0f991445 | ||
|
|
b71678be3e | ||
|
|
f21bebd7d3 | ||
|
|
d0143fb99e | ||
|
|
d192ad0aba | ||
|
|
3bee5aeb33 | ||
|
|
5cb8787442 | ||
|
|
334c6c32a5 | ||
|
|
d4b7879e16 | ||
|
|
d8573f888f | ||
|
|
cac5e6ba5b | ||
|
|
655a68b116 | ||
|
|
524f96d401 | ||
|
|
28ab8fcce3 | ||
|
|
6da0ea7f9b | ||
|
|
11a529635a | ||
|
|
bc31c50167 | ||
|
|
07e991cfab | ||
|
|
0f3c8c6996 | ||
|
|
0f070625cd | ||
|
|
ed8cbae509 | ||
|
|
4b5a2df0dd | ||
|
|
c8e1fb0d1b | ||
|
|
fe1fb219a6 | ||
|
|
28fa18d5af | ||
|
|
a0873811e5 | ||
|
|
40e84d601c | ||
|
|
ec13f51fd9 | ||
|
|
3140d34146 | ||
|
|
3ed8463058 | ||
|
|
ea1d3cefff | ||
|
|
e298441a67 | ||
|
|
4387feb4b8 | ||
|
|
cfa65e13b2 | ||
|
|
eb9afeffe2 | ||
|
|
110b7e289f | ||
|
|
57c075ed5f | ||
|
|
dd36cc6914 | ||
|
|
15f07d3078 | ||
|
|
c0c96adb24 | ||
|
|
b36969554e | ||
|
|
0c6f4a1284 | ||
|
|
9358097a71 | ||
|
|
ed17cacb74 | ||
|
|
e0cd865b68 | ||
|
|
ed7b74af50 | ||
|
|
8c0903ea07 | ||
|
|
29856365a6 | ||
|
|
a7661122af | ||
|
|
1181181b70 | ||
|
|
32090e561e | ||
|
|
07a46e3fca | ||
|
|
b43e3143da | ||
|
|
9c99934303 | ||
|
|
34757b89f7 | ||
|
|
e3b93a10e2 | ||
|
|
b043969cfd | ||
|
|
101829e6c0 | ||
|
|
8cd8f9f071 | ||
|
|
c010bcbe2f | ||
|
|
1b176ae96b | ||
|
|
ecdc355d15 | ||
|
|
79fae44cb3 | ||
|
|
34b3c277a4 | ||
|
|
bd911ffe7e | ||
|
|
e6f30b78b7 | ||
|
|
9145a27b50 |
@@ -144,6 +144,61 @@
|
||||
"name": "Benedek Kozma",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/8356175?v=4",
|
||||
"profile": "https://github.com/Cyberbeni",
|
||||
"contributions": [
|
||||
"ideas",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "coffeegoddd",
|
||||
"name": "Dustin Brown",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/43383835?v=4",
|
||||
"profile": "https://github.com/coffeegoddd",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Chocrates",
|
||||
"name": "Chris McIntosh",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/1758164?v=4",
|
||||
"profile": "https://github.com/Chocrates",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "kbsali",
|
||||
"name": "Kevin Saliou",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/53676?v=4",
|
||||
"profile": "https://github.com/kbsali",
|
||||
"contributions": [
|
||||
"ideas"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ewjoachim",
|
||||
"name": "Joachim Jablon",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/1457576?v=4",
|
||||
"profile": "https://github.com/ewjoachim",
|
||||
"contributions": [
|
||||
"ideas"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "trallnag",
|
||||
"name": "Tim Schwenke",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/24834206?v=4",
|
||||
"profile": "https://github.com/trallnag",
|
||||
"contributions": [
|
||||
"ideas"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "PssbleTrngle",
|
||||
"name": "Possible Triangle",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/12880806?v=4",
|
||||
"profile": "https://www.somethingcatchy.net",
|
||||
"contributions": [
|
||||
"ideas"
|
||||
]
|
||||
|
||||
64
.eslintrc
64
.eslintrc
@@ -1,64 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": true,
|
||||
"amd": true,
|
||||
"es6": true
|
||||
},
|
||||
"root": true,
|
||||
"extends": [
|
||||
"eslint:recommended"
|
||||
],
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-cond-assign": [
|
||||
2,
|
||||
"except-parens"
|
||||
],
|
||||
"no-use-before-define": [
|
||||
2,
|
||||
{
|
||||
"functions": false,
|
||||
"classes": false,
|
||||
"variables": false
|
||||
}
|
||||
],
|
||||
"new-cap": 0,
|
||||
"no-caller": 2,
|
||||
"no-undef": 2,
|
||||
"no-unused-vars": 0,
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
"no-empty": [
|
||||
"error",
|
||||
{
|
||||
"allowEmptyCatch": true
|
||||
}
|
||||
],
|
||||
"no-console": "off",
|
||||
"prefer-const": [
|
||||
"warn",
|
||||
{
|
||||
"destructuring": "all"
|
||||
}
|
||||
],
|
||||
"quotes": [
|
||||
"warn",
|
||||
"single"
|
||||
],
|
||||
"semi": [
|
||||
"warn",
|
||||
"never"
|
||||
],
|
||||
"spaced-comment": "warn"
|
||||
}
|
||||
}
|
||||
38
.eslintrc.js
Normal file
38
.eslintrc.js
Normal file
@@ -0,0 +1,38 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
commonjs: true,
|
||||
es6: true,
|
||||
node: true
|
||||
},
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
'plugin:prettier/recommended'
|
||||
],
|
||||
globals: {},
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'module'
|
||||
},
|
||||
plugins: ['@typescript-eslint'],
|
||||
rules: {
|
||||
'prettier/prettier': 'warn',
|
||||
'no-cond-assign': [2, 'except-parens'],
|
||||
'no-unused-vars': 0,
|
||||
'@typescript-eslint/no-unused-vars': 1,
|
||||
'no-empty': [
|
||||
'error',
|
||||
{
|
||||
allowEmptyCatch: true
|
||||
}
|
||||
],
|
||||
'prefer-const': [
|
||||
'warn',
|
||||
{
|
||||
destructuring: 'all'
|
||||
}
|
||||
],
|
||||
'spaced-comment': 'warn'
|
||||
}
|
||||
}
|
||||
10
.github/ISSUE_TEMPLATE/blank-issue.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/blank-issue.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Blank issue
|
||||
about: Just a blank template
|
||||
title: ''
|
||||
labels: 'status: pending'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
24
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
24
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report an issue with the action
|
||||
title: ''
|
||||
labels: 'status: pending'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is. If a particular error is shown
|
||||
|
||||
**Workflow used**
|
||||
Provide a snippet of the workflow and/or a link to it (use the commit sha as the ref when you link it, so that it's not influenced by other changes). If you only share a section of the workflow, make sure it includes the step that uses the action!
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Logs**
|
||||
Either provide a link to the action run or (if your repo is private) paste here the logs from the step that uses it. If you paste the logs, please use this template, and remember to paste the logs from all the different sections.
|
||||
<details>
|
||||
<summary>Logs</summary>
|
||||
<pre><code>Your logs here.</code></pre>
|
||||
</details>
|
||||
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
||||
10
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Question
|
||||
about: Ask a question on how to use the action
|
||||
title: ''
|
||||
labels: 'type: question'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
16
.github/dependabot.yml
vendored
Normal file
16
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: 'npm' # See documentation for possible values
|
||||
directory: '/' # Location of package manifests
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
commit-message:
|
||||
prefix: 'chore'
|
||||
include: 'scope'
|
||||
labels:
|
||||
- 'type: dependencies'
|
||||
80
.github/labels.yml
vendored
Normal file
80
.github/labels.yml
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
# General purpose
|
||||
- name: 'good first issue'
|
||||
color: '5319e7'
|
||||
description: 'Good for newcomers'
|
||||
aliases: []
|
||||
|
||||
- name: 'help wanted'
|
||||
color: '008672'
|
||||
description: 'Extra attention is needed'
|
||||
aliases: []
|
||||
|
||||
- name: 'status: pending'
|
||||
color: c5def5
|
||||
description: 'More info is needed before deciding what to do.'
|
||||
aliases: []
|
||||
|
||||
- name: 'status: pinned'
|
||||
color: 0052cc
|
||||
description: 'Issues and PRs that should not be labeled as stale or closed if they remain inactive.'
|
||||
aliases: []
|
||||
|
||||
- name: 'status: stale'
|
||||
color: fbca04
|
||||
description: 'Inactive issues and PRs.'
|
||||
aliases: ['stale']
|
||||
|
||||
- name: 'status: wontfix'
|
||||
color: ffffff
|
||||
description: 'This will not be worked on.'
|
||||
aliases: ['wontfix']
|
||||
|
||||
- name: 'type: automation'
|
||||
color: 2fc904
|
||||
description: 'About actions workflows and automation.'
|
||||
aliases: ['automation', 'actions']
|
||||
|
||||
- name: 'type: bug'
|
||||
color: d73a4a
|
||||
description: 'Verified problems that need to be worked on.'
|
||||
aliases: ['bug']
|
||||
|
||||
- name: 'type: dependencies'
|
||||
color: 0366d6
|
||||
description: 'Pull requests that update a dependency file'
|
||||
aliases: ['dependencies']
|
||||
|
||||
- name: 'type: duplicate'
|
||||
color: cfd3d7
|
||||
description: 'This issue or pull request already exists.'
|
||||
aliases: ['duplicate']
|
||||
|
||||
- name: 'type: enhancement'
|
||||
color: a2eeef
|
||||
description: 'New feature or request.'
|
||||
aliases: ['enhancement']
|
||||
|
||||
- name: 'type: invalid'
|
||||
color: e4e669
|
||||
description: "This doesn't seem right."
|
||||
aliases: ['invalid']
|
||||
|
||||
- name: 'type: maintenance'
|
||||
color: 0075ca
|
||||
description: "Documentation improvements and code refactoring, doesn't affect functionality."
|
||||
aliases: ['documentation', 'docs']
|
||||
|
||||
- name: 'type: not a bug'
|
||||
color: 0e8a16
|
||||
description: 'Reports that happen not be our fault.'
|
||||
aliases: ['not a bug']
|
||||
|
||||
- name: 'type: question'
|
||||
color: d876e3
|
||||
description: 'Further information is requested.'
|
||||
aliases: ['question']
|
||||
|
||||
- name: 'type: security'
|
||||
color: 'ee0701'
|
||||
description: 'Pull requests that address a security vulnerability.'
|
||||
aliases: ['security']
|
||||
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@@ -1,6 +1,8 @@
|
||||
name: Build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- src/**
|
||||
- .github/workflows/build.yml
|
||||
@@ -25,13 +27,5 @@ jobs:
|
||||
with:
|
||||
message: '[auto] build: update compiled version'
|
||||
add: lib
|
||||
force: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: EndBug/add-and-commit@v4
|
||||
with:
|
||||
message: '[auto] build: update input typings'
|
||||
add: src/inputs.ts
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
29
.github/workflows/docs.yml
vendored
29
.github/workflows/docs.yml
vendored
@@ -1,29 +0,0 @@
|
||||
name: Docs
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .all-contributorsrc
|
||||
- .github/workflows/docs.yml
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
contributors:
|
||||
name: Update contributors badge
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
|
||||
- run: npm install
|
||||
|
||||
- run: npm run all-contributors-badge
|
||||
|
||||
- uses: EndBug/add-and-commit@v4.0.0
|
||||
with:
|
||||
message: "[auto] docs: update contributors badge"
|
||||
add: README.md
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
21
.github/workflows/export-labels.yml
vendored
Normal file
21
.github/workflows/export-labels.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Export label config
|
||||
on:
|
||||
# You can run this with every event, but it's better to run it only when you actually need it.
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
labels:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: EndBug/export-label-config@main
|
||||
with:
|
||||
# This is needed if you're dealing with private repos.
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Set this to `true` if you want to get the raw API reponse. Defaults to `false`.
|
||||
raw-result: false
|
||||
|
||||
# By default every label entry will have an `aliases` property set to an empty array.
|
||||
# It's for EndBug/label-sync, if you don't want it you cans set this to `false`
|
||||
add-aliases: true
|
||||
19
.github/workflows/label-sync.yml
vendored
Normal file
19
.github/workflows/label-sync.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Sync labels
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/labels.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
name: Run EndBug/label-sync
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: EndBug/label-sync@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
config-file: '.github/labels.yml'
|
||||
22
.github/workflows/test.yml
vendored
Normal file
22
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Test
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test build
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm i
|
||||
- run: npm run build
|
||||
|
||||
lint:
|
||||
name: Check linting
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm i
|
||||
- run: npm run lint
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,2 @@
|
||||
node_modules
|
||||
build
|
||||
lib
|
||||
|
||||
7
.prettierrc
Normal file
7
.prettierrc
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
110
CHANGELOG.md
110
CHANGELOG.md
@@ -1,4 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
@@ -6,113 +7,205 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [5.1.0] - 2020-10-07
|
||||
## [6.2.0] - 2020-12-23
|
||||
|
||||
### Added:
|
||||
- The default commit message now displays the name of the workflow too (issue #64)
|
||||
|
||||
- `push` input: allow for custom `git push` arguments to be used, more info in the README. (issue #100)
|
||||
|
||||
## [6.1.0] - 2020-12-22
|
||||
|
||||
### Added:
|
||||
|
||||
- `token` input: you can now use this instead of setting the `GITHUB_TOKEN` env variable, which has been deprecated. This input is optional, its default value is the default `secrets.GITHUB_TOKEN`. You only need to use this if you want the action to run with a PAT. (issue #110)
|
||||
|
||||
### Deprecated:
|
||||
|
||||
- `GITHUB_TOKEN`: the use of this env variable is now deprecated in favor of the `token` input, you'll start receiving warnings if you keep using it. (issue #110)
|
||||
|
||||
## [6.0.0] - 2020-12-22
|
||||
|
||||
### Added:
|
||||
|
||||
- (BREAKING?) Multiple git commands: support JSON/YAML arrays for the `add` and `remove` parameters (you still need pass a string as input, but that can be parsed to an array by the action). Using them will run multiple commands in succession. I don't think this will be really breaking anything, but I've used a major version change just to be sure. There's more info about this stuff on the README. (issue #95)
|
||||
|
||||
## [5.3.0] - 2020-12-12
|
||||
|
||||
### Added:
|
||||
|
||||
- Outputs: the action now has 3 outputs (`committed`, `pushed`, and `tagged`) that will be set to either `true` or `false` to tell you what the action has done. The outputs are also shown in the action logs.
|
||||
|
||||
## [5.2.0] - 2020-11-11
|
||||
|
||||
### Added:
|
||||
|
||||
- New `push` option: this lets you tell the action whether to push commit and tags to the repo. The default value is `true`, so that the default behavior is not changed. (issue #86)
|
||||
|
||||
## [5.1.2] - 2020-11-10
|
||||
|
||||
### Fixed:
|
||||
|
||||
- Fixed an issue with the build (issue #88)
|
||||
|
||||
## [5.1.1] - 2020-11-07
|
||||
|
||||
### Fixed:
|
||||
|
||||
- Fixed typo in parameter name: `pull_strategy` was written as `pull_stategy` (PR #83)
|
||||
|
||||
## [5.1.0] - 2020-10-07
|
||||
|
||||
### Added:
|
||||
|
||||
- The default commit message now displays the name of the workflow too (issue #64)
|
||||
|
||||
## [5.0.0] - 2020-09-27
|
||||
|
||||
### Changed:
|
||||
|
||||
- **[BREAKING]** Action parameters: multiple action parameters have been changed, refer to the docs for better info
|
||||
- The code is now entirely in TypeScript (PR #57)
|
||||
|
||||
### Fixed:
|
||||
|
||||
- Improved input checks
|
||||
- Logs are now displayed on Windows too
|
||||
- Remove unnecessary steps
|
||||
- Remove unused dependencies
|
||||
|
||||
## [4.4.0] - 2020-07-31
|
||||
|
||||
### Added:
|
||||
|
||||
- Pull requests: the action can now work in runs triggered by pull request events (issue #48)
|
||||
|
||||
## [4.3.0] - 2020-07-29
|
||||
|
||||
### Addded:
|
||||
|
||||
- `signoff` parameter: lets you use the `--signoff` argument for the `git commit` command (PR #46)
|
||||
|
||||
## [4.2.1] - 2020-07-10
|
||||
|
||||
### Fixed:
|
||||
|
||||
- OS-support: the action now properly works on Windows instances (issue #33)
|
||||
|
||||
## [4.2.0] - 2020-05-17
|
||||
|
||||
### Added:
|
||||
|
||||
- Tagging: you can now create and update lightweight tags (PR #30)
|
||||
|
||||
## [4.1.0] - 2020-05-01
|
||||
### Added:
|
||||
|
||||
### Added:
|
||||
|
||||
- `ref` parameter: lets you choose the branch to run the action on, the default is the one that triggered the workflow (issue #29)
|
||||
|
||||
## [4.0.3] - 2020-05-01
|
||||
|
||||
### Fixed:
|
||||
|
||||
- Logs: `git diff` won't display logs anymore, to avoid buffer problems (issue #27)
|
||||
- Logs: additional info will be logged along with the command outputs
|
||||
- Logs: added groups to improve readability
|
||||
|
||||
## [4.0.2] - 2020-04-19
|
||||
|
||||
### Fixed:
|
||||
|
||||
- Error handling: failures are now easier to read (issue #25)
|
||||
|
||||
## [4.0.1] - 2020-03-20
|
||||
|
||||
### Fixed:
|
||||
|
||||
- Scheduled events: the action can be used in action runs triggered by a scheduled events
|
||||
- Warnings: there won't be warnings when both `author_name` and `author_email` are set
|
||||
|
||||
## [4.0.0] - 2020-03-03
|
||||
|
||||
### Removed:
|
||||
|
||||
- **[BREAKING]** `path` parameter: see 'Changed' section for more info
|
||||
- **[BREAKING]** `pattern` parameter: see 'Changed' section for more info
|
||||
|
||||
### Changed:
|
||||
|
||||
- The action now uses `git add` and `git rm` commands, you can choose their arguemnts directly by using the `add` and `remove` parameters
|
||||
- **[BREAKING]** Error handling: the action won't stop if one of your git commands fails (e.g. if one of your pathspecs doesn't match any file)
|
||||
|
||||
## [3.1.0] - 2020-02-21
|
||||
|
||||
### Added:
|
||||
|
||||
- `remove` parameter: lets you delete files directly from the action
|
||||
|
||||
## [3.0.0] - 2020-01-24
|
||||
|
||||
### Added:
|
||||
|
||||
- The action can now run in multiple subsequent jobs in the same workflow
|
||||
|
||||
### Removed:
|
||||
|
||||
- **[BREAKING]** [`actions/checkout@v1`](https://github.com/actions/checkout/tree/v1) support is being dropped in favor of [`actions/checkout@v2`](https://github.com/actions/checkout/releases/tag/v2)
|
||||
|
||||
## [2.3.2] - 2019-12-29
|
||||
|
||||
### Added:
|
||||
|
||||
- `cwd` parameter: lets you set the Current Working Directory
|
||||
|
||||
## [2.3.1] - 2019-12-20
|
||||
### Added:
|
||||
|
||||
### Added:
|
||||
|
||||
- Short tags: from now on, there will be short major tags available (`v2`, `v3`, ...)
|
||||
|
||||
## [2.3.0] - 2019-12-14
|
||||
|
||||
### Changed:
|
||||
|
||||
- TypeScript rewrite: the action will run faster because, unlike with Docker, no build process is needed
|
||||
|
||||
### Added:
|
||||
|
||||
- OS support: the action can now run in non-Linux environments too
|
||||
|
||||
## [2.2.0] - 2019-12-14
|
||||
|
||||
### Added:
|
||||
|
||||
- The action can automatically fetch the commit author to use
|
||||
- You can manually provide the author using the `author_name` and `author_email` parameters
|
||||
|
||||
## [2.1.1] - 2019-12-07
|
||||
|
||||
### Fixed:
|
||||
|
||||
- The action can now be used multiple times in the same workflow
|
||||
|
||||
## [2.1.0] - 2019-09-19
|
||||
|
||||
### Added:
|
||||
|
||||
- `force` parameter: uses `--force` when running `git add`
|
||||
|
||||
## [2.0.0] - 2019-09-18
|
||||
|
||||
### Changed:
|
||||
|
||||
- **[BREAKING]** The action now uses a `find` command
|
||||
|
||||
## [1.0.0] - 2019-09-17
|
||||
|
||||
First release
|
||||
|
||||
#
|
||||
[Unreleased]: https://github.com/EndBug/add-and-commit/compare/v5.1.0...HEAD
|
||||
|
||||
[unreleased]: https://github.com/EndBug/add-and-commit/compare/v6.2.0...HEAD
|
||||
[1.0.0]: https://github.com/EndBug/add-and-commit/tree/v1.0.0
|
||||
[2.0.0]: https://github.com/EndBug/add-and-commit/compare/v1.0.0...v2.0.0
|
||||
[2.1.0]: https://github.com/EndBug/add-and-commit/compare/v2.0.0...v2.1.0
|
||||
@@ -134,3 +227,10 @@ First release
|
||||
[4.4.0]: https://github.com/EndBug/add-and-commit/compare/v4.3.0...v4.4.0
|
||||
[5.0.0]: https://github.com/EndBug/add-and-commit/compare/v4.4.0...v5.0.0
|
||||
[5.1.0]: https://github.com/EndBug/add-and-commit/compare/v5.0.0...v5.1.0
|
||||
[5.1.1]: https://github.com/EndBug/add-and-commit/compare/v5.1.0...v5.1.1
|
||||
[5.1.2]: https://github.com/EndBug/add-and-commit/compare/v5.1.1...v5.1.2
|
||||
[5.2.0]: https://github.com/EndBug/add-and-commit/compare/v5.1.2...v5.2.0
|
||||
[5.3.0]: https://github.com/EndBug/add-and-commit/compare/v5.2.0...v5.3.0
|
||||
[6.0.0]: https://github.com/EndBug/add-and-commit/compare/v5.3.0...v6.0.0
|
||||
[6.1.0]: https://github.com/EndBug/add-and-commit/compare/v6.0.0...v6.1.0
|
||||
[6.2.0]: https://github.com/EndBug/add-and-commit/compare/v6.1.0...v6.2.0
|
||||
|
||||
122
README.md
122
README.md
@@ -1,6 +1,7 @@
|
||||
# Add & Commit
|
||||
<a href="https://github.com/search?o=desc&q=EndBug%2Fadd-and-commit+path%3A.github%2Fworkflows+language%3AYAML&s=&type=Code" target="_blank" title="Public workflows that use this action."><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fapi-git-master.endbug.vercel.app%2Fapi%2Fgithub-actions%2Fused-by%3Faction%3DEndBug%2Fadd-and-commit%26badge%3Dtrue" alt="Public workflows that use this action."></a>
|
||||
[](#contributors-)
|
||||
|
||||
[](https://github.com/search?o=desc&q=EndBug+add-and-commit+path%3A.github%2Fworkflows+language%3AYAML&s=&type=Code)
|
||||
[](#contributors-)
|
||||
|
||||
You can use this GitHub Action to commit changes made in your workflow run directly to your repo: for example, you use it to lint your code, update documentation, commit updated builds, etc....
|
||||
|
||||
@@ -12,7 +13,7 @@ This action lets you choose the path that you want to use when adding & committi
|
||||
Add a step like this to your workflow:
|
||||
|
||||
```yaml
|
||||
- uses: EndBug/add-and-commit@v5 # You can change this to use a specific version
|
||||
- uses: EndBug/add-and-commit@v6 # You can change this to use a specific version
|
||||
with:
|
||||
# The arguments for the `git add` command (see the paragraph below for more info)
|
||||
# Default: '.'
|
||||
@@ -38,9 +39,17 @@ Add a step like this to your workflow:
|
||||
# Default: 'Commit from GitHub Actions (name of the workflow)'
|
||||
message: 'Your commit message'
|
||||
|
||||
# The flag used on the pull strategy
|
||||
# Default: '--no-rebase'
|
||||
pull_strategy: '--no-rebase or --no-ff or --rebase'
|
||||
|
||||
# Whether to push the commit and, if any, its tags to the repo. It can also be used to set the git push arguments (see the paragraph below for more info)
|
||||
# Default: true
|
||||
push: false
|
||||
|
||||
# The arguments for the `git rm` command (see the paragraph below for more info)
|
||||
# Default: ''
|
||||
remove: "./dir/old_file.js"
|
||||
remove: './dir/old_file.js'
|
||||
|
||||
# Whether to use the --signoff option on `git commit` (only `true` and `false` are accepted)
|
||||
# Default: false
|
||||
@@ -48,32 +57,50 @@ Add a step like this to your workflow:
|
||||
|
||||
# Arguments for the git tag command (the tag name always needs to be the first word not preceded by an hyphen)
|
||||
# Default: ''
|
||||
tag: "v1.0.0 --force"
|
||||
tag: 'v1.0.0 --force'
|
||||
|
||||
env:
|
||||
# This is necessary in order to push a commit to the repo
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
|
||||
# Token to use for pushing the commit. The default value won't trigger any workflows, you need to use a Personal Access Token for that.
|
||||
# Default: secrets.GITHUB_TOKEN
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
### Environment variables:
|
||||
|
||||
The only `env` variable required is the token for the action to run: GitHub generates one automatically, but you need to pass it through `env` to make it available to actions. You can find more about `GITHUB_TOKEN` [here](https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret).
|
||||
That said, you can just copy the example line and not worry about it. If you do want to use a different token you can pass that in, but I wouldn't see any possible advantage in doing so.
|
||||
|
||||
### Adding files:
|
||||
|
||||
The action adds files using a regular `git add` command, so you can put every kind of argument in the `add` option. For example, if you want to force-add a file: `./path/to/file.txt --force`.
|
||||
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
|
||||
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
|
||||
You can also use JSON or YAML arrays (e.g. `'["first", "second"]'`, `"['first', 'second']"`) to make the action run multiple `git add` commands: the action will log how your input has been parsed. Please mind that your input still needs to be a string because of how GitHub Actions works with inputs: just write your array inside the string, the action will parse it later.
|
||||
|
||||
### Deleting files:
|
||||
|
||||
You can delete files with the `remove` option: that runs a `git rm` command that will stage the files in the given path for removal. As with the `add` argument, you can use every option `git rm` allows (e.g. add `--force` to ignore `.gitignore` rules).
|
||||
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
|
||||
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
|
||||
You can also use JSON or YAML arrays (e.g. `'["first", "second"]'`, `"['first', 'second']"`) to make the action run multiple `git rm` commands: the action will log how your input has been parsed. Please mind that your input still needs to be a string because of how GitHub Actions works with inputs: just write your array inside the string, the action will parse it later.
|
||||
|
||||
### Pushing:
|
||||
|
||||
By default the action runs the following command: `git push origin ${branch input} --set-upstream`. You can use the `push` input to modify this behavior, here's what you can set it to:
|
||||
|
||||
- `true`: this is the default value, it will behave as usual.
|
||||
- `false`: this prevents the action from pushing at all, no `git push` command is run.
|
||||
- any other string:
|
||||
The action will use your string as the arguments for the `git push` command. Please note that nothing is used other than your arguments, and the command will result in `git push ${push input}` (no remote, no branch, no `--set-upstream`, you have to include them yourself).
|
||||
|
||||
One way to use this is if you want to force push to a branch of your repo: you'll need to set the `push` input to, for example, `origin yourBranch --force`.
|
||||
|
||||
### Tagging:
|
||||
|
||||
You can use the `tag` option to enter the arguments for a `git add` command. In order for the action to isolate the tag name from the rest of the arguments, it should be the first word not preceded by an hyphen (e.g. `-a tag-name -m "some other stuff"` is ok).
|
||||
|
||||
### Outputs:
|
||||
|
||||
The action provides these outputs:
|
||||
|
||||
- `committed`: whether the action has created a commit (`'true'` or `'false'`)
|
||||
- `pushed`: whether the action has pushed to teh remote(`'true'` or `'false'`)
|
||||
- `tagged`: whether the action has created a tag (`'true'` or `'false'`)
|
||||
|
||||
For more info on how to use outputs, see ["Context and expression syntax"](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions).
|
||||
|
||||
### Examples:
|
||||
|
||||
Do you want to lint your JavaScript files, located in the `src` folder, with ESLint, so that fixable changes are done without your intervention? You can use a workflow like this:
|
||||
@@ -82,34 +109,32 @@ Do you want to lint your JavaScript files, located in the `src` folder, with ESL
|
||||
name: Lint source code
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
jobs:
|
||||
run:
|
||||
name: Lint with ESLint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
|
||||
- name: Update source code
|
||||
run: eslint "src/**" --fix
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Commit changes
|
||||
uses: EndBug/add-and-commit@v5
|
||||
with:
|
||||
author_name: Your Name
|
||||
author_email: mail@example.com
|
||||
message: "Your commit message"
|
||||
add: "*.js"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Update source code
|
||||
run: eslint "src/**" --fix
|
||||
|
||||
- name: Commit changes
|
||||
uses: EndBug/add-and-commit@v6
|
||||
with:
|
||||
author_name: Your Name
|
||||
author_email: mail@example.com
|
||||
message: 'Your commit message'
|
||||
add: '*.js'
|
||||
```
|
||||
|
||||
If you need to run the action on a repository that is not located in [`$GITHUB_WORKSPACE`](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables), you can use the `cwd` option: the action uses a `cd` normal command, so the path should follow bash standards.
|
||||
@@ -118,7 +143,7 @@ If you need to run the action on a repository that is not located in [`$GITHUB_W
|
||||
name: Use a different repository directory
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
jobs:
|
||||
run:
|
||||
name: Add a text file
|
||||
runs-on: ubuntu-latest
|
||||
@@ -127,19 +152,17 @@ jobs:
|
||||
# If you need to, you can check out your repo to a different location
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: "./pathToRepo/"
|
||||
path: './pathToRepo/'
|
||||
|
||||
# You can make whatever type of change to the repo...
|
||||
- run: echo "123" > ./pathToRepo/file.txt
|
||||
|
||||
# ...and then use the action as you would normally do, but providing the path to the repo
|
||||
- uses: EndBug/add-and-commit@v5
|
||||
- uses: EndBug/add-and-commit@v6
|
||||
with:
|
||||
message: "Add the very useful text file"
|
||||
add: "*.txt --force"
|
||||
cwd: "./pathToRepo/"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
message: 'Add the very useful text file'
|
||||
add: '*.txt --force'
|
||||
cwd: './pathToRepo/'
|
||||
```
|
||||
|
||||
## Contributors ✨
|
||||
@@ -169,12 +192,19 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
||||
<td align="center"><a href="http://hoten.cc"><img src="https://avatars1.githubusercontent.com/u/4071474?v=4" width="100px;" alt=""/><br /><sub><b>Connor Clark</b></sub></a><br /><a href="#ideas-connorjclark" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Cyberbeni"><img src="https://avatars1.githubusercontent.com/u/8356175?v=4" width="100px;" alt=""/><br /><sub><b>Benedek Kozma</b></sub></a><br /><a href="#ideas-Cyberbeni" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://github.com/Cyberbeni"><img src="https://avatars1.githubusercontent.com/u/8356175?v=4" width="100px;" alt=""/><br /><sub><b>Benedek Kozma</b></sub></a><br /><a href="#ideas-Cyberbeni" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/EndBug/add-and-commit/commits?author=Cyberbeni" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/coffeegoddd"><img src="https://avatars3.githubusercontent.com/u/43383835?v=4" width="100px;" alt=""/><br /><sub><b>Dustin Brown</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3Acoffeegoddd" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://github.com/Chocrates"><img src="https://avatars1.githubusercontent.com/u/1758164?v=4" width="100px;" alt=""/><br /><sub><b>Chris McIntosh</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3AChocrates" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://github.com/kbsali"><img src="https://avatars0.githubusercontent.com/u/53676?v=4" width="100px;" alt=""/><br /><sub><b>Kevin Saliou</b></sub></a><br /><a href="#ideas-kbsali" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://github.com/ewjoachim"><img src="https://avatars0.githubusercontent.com/u/1457576?v=4" width="100px;" alt=""/><br /><sub><b>Joachim Jablon</b></sub></a><br /><a href="#ideas-ewjoachim" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://github.com/trallnag"><img src="https://avatars3.githubusercontent.com/u/24834206?v=4" width="100px;" alt=""/><br /><sub><b>Tim Schwenke</b></sub></a><br /><a href="#ideas-trallnag" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
<td align="center"><a href="https://www.somethingcatchy.net"><img src="https://avatars1.githubusercontent.com/u/12880806?v=4" width="100px;" alt=""/><br /><sub><b>Possible Triangle</b></sub></a><br /><a href="#ideas-PssbleTrngle" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-enable -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
||||
|
||||
20
action.yml
20
action.yml
@@ -22,6 +22,14 @@ inputs:
|
||||
message:
|
||||
description: The message for the commit
|
||||
required: false
|
||||
pull_strategy:
|
||||
description: The flag used on the pull strategy
|
||||
required: false
|
||||
default: '--no-rebase'
|
||||
push:
|
||||
description: Whether to push the commit and, if any, its tags to the repo. It can also be used to set the git push arguments (more info in the README)
|
||||
required: false
|
||||
default: 'true'
|
||||
remove:
|
||||
description: Arguments for the git rm command
|
||||
required: false
|
||||
@@ -31,6 +39,18 @@ inputs:
|
||||
tag:
|
||||
description: Arguments for the git tag command (the tag name always needs to be the first word not preceded by a hyphen)
|
||||
required: false
|
||||
token:
|
||||
description: 'GITHUB_TOKEN or a `repo` scoped Personal Access Token (PAT)'
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
|
||||
outputs:
|
||||
committed:
|
||||
description: Whether the action has created a commit.
|
||||
pushed:
|
||||
description: Whether the action has pushed to the remote.
|
||||
tagged:
|
||||
description: Whether the action has created a tag.
|
||||
|
||||
runs:
|
||||
using: node12
|
||||
|
||||
File diff suppressed because one or more lines are too long
405
package-lock.json
generated
405
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "add-and-commit",
|
||||
"version": "5.0.0",
|
||||
"version": "6.2.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -30,9 +30,9 @@
|
||||
}
|
||||
},
|
||||
"@babel/runtime": {
|
||||
"version": "7.11.2",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz",
|
||||
"integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==",
|
||||
"version": "7.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
|
||||
"integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"regenerator-runtime": "^0.13.4"
|
||||
@@ -63,6 +63,12 @@
|
||||
"integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/js-yaml": {
|
||||
"version": "3.12.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-3.12.5.tgz",
|
||||
"integrity": "sha512-JCcp6J0GV66Y4ZMDAQCXot4xprYB+Zfd3meK9+INSJeVZwJmHAW30BBEEkPzXswMXuiyReUGOP3GxrADc9wPww==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/json-schema": {
|
||||
"version": "7.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz",
|
||||
@@ -75,10 +81,10 @@
|
||||
"integrity": "sha512-ge4xZ3vSBornVYlDnk7yZ0gK6ChHf/CHB7Gl1I0Jhah8DDnEQqBzgohYG4FX4p81TNirSETOiSyn+y1r9/IR6w==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/yamljs": {
|
||||
"version": "0.2.31",
|
||||
"resolved": "https://registry.npmjs.org/@types/yamljs/-/yamljs-0.2.31.tgz",
|
||||
"integrity": "sha512-QcJ5ZczaXAqbVD3o8mw/mEBhRvO5UAdTtbvgwL/OgoWubvNBh6/MxLBAigtcgIFaq3shon9m3POIxQaLQt4fxQ==",
|
||||
"@types/parse-json": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
|
||||
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
|
||||
"dev": true
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
@@ -152,9 +158,9 @@
|
||||
}
|
||||
},
|
||||
"@vercel/ncc": {
|
||||
"version": "0.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.23.0.tgz",
|
||||
"integrity": "sha512-Fcr1qlG9t54X4X9qbo/+jr1+t5Qc6H3TgIRBXmKkF/WDs6YFulAN6ilq2Ehx38RbgIOFxaZnjlAQ50GyexnMpQ==",
|
||||
"version": "0.26.1",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.26.1.tgz",
|
||||
"integrity": "sha512-iVhYAL/rpHgjO88GkDHNVNrp7WTfMFBbeWXNgwaDPMv5rDI4hNOAM0u+Zhtbs42XBQE6EccNaY6UDb/tm1+dhg==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn": {
|
||||
@@ -182,9 +188,9 @@
|
||||
}
|
||||
},
|
||||
"all-contributors-cli": {
|
||||
"version": "6.17.2",
|
||||
"resolved": "https://registry.npmjs.org/all-contributors-cli/-/all-contributors-cli-6.17.2.tgz",
|
||||
"integrity": "sha512-1ip57waUGz92HWbM5VgiGOjBz25fWXOtCRtCFbjCuuiCuiYbygnvcb9iFYiyNz28RlECg1VPXWrXOJABq+h+MQ==",
|
||||
"version": "6.19.0",
|
||||
"resolved": "https://registry.npmjs.org/all-contributors-cli/-/all-contributors-cli-6.19.0.tgz",
|
||||
"integrity": "sha512-QJN4iLeTeYpTZJES8XFTzQ+itA1qSyBbxLapJLtwrnY+kipyRhCX49fS/s/qftQQym9XLATMZUpUeEeJSox1sw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.7.6",
|
||||
@@ -200,12 +206,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
|
||||
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/color-name": "^1.1.1",
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
@@ -241,9 +246,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
|
||||
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
@@ -293,7 +298,6 @@
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
@@ -311,11 +315,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
|
||||
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
|
||||
"version": "0.21.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz",
|
||||
"integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==",
|
||||
"requires": {
|
||||
"follow-redirects": "1.5.10"
|
||||
"follow-redirects": "^1.10.0"
|
||||
}
|
||||
},
|
||||
"balanced-match": {
|
||||
@@ -369,6 +373,12 @@
|
||||
"integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
|
||||
"dev": true
|
||||
},
|
||||
"ci-info": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
|
||||
"integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==",
|
||||
"dev": true
|
||||
},
|
||||
"cli-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
|
||||
@@ -421,12 +431,37 @@
|
||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||
"dev": true
|
||||
},
|
||||
"compare-versions": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz",
|
||||
"integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==",
|
||||
"dev": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"cosmiconfig": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz",
|
||||
"integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/parse-json": "^4.0.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
"parse-json": "^5.0.0",
|
||||
"path-type": "^4.0.0",
|
||||
"yaml": "^1.10.0"
|
||||
}
|
||||
},
|
||||
"create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "6.0.5",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||
@@ -495,6 +530,15 @@
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"dev": true
|
||||
},
|
||||
"error-ex": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
|
||||
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-arrayish": "^0.2.1"
|
||||
}
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
@@ -563,6 +607,24 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint-config-prettier": {
|
||||
"version": "6.15.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz",
|
||||
"integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"get-stdin": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"eslint-plugin-prettier": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.0.tgz",
|
||||
"integrity": "sha512-tMTwO8iUWlSRZIwS9k7/E4vrTsfvsrcM5p1eftyuqWH25nKsz/o6/54I7jwQ/3zobISyC7wMy9ZsFwgTxOcOpQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"prettier-linter-helpers": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"eslint-scope": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz",
|
||||
@@ -602,8 +664,7 @@
|
||||
"esprima": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
|
||||
"dev": true
|
||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
||||
},
|
||||
"esquery": {
|
||||
"version": "1.1.0",
|
||||
@@ -652,6 +713,12 @@
|
||||
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
|
||||
"dev": true
|
||||
},
|
||||
"fast-diff": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
|
||||
"integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
|
||||
"dev": true
|
||||
},
|
||||
"fast-json-stable-stringify": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
|
||||
@@ -692,6 +759,15 @@
|
||||
"path-exists": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"find-versions": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz",
|
||||
"integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"semver-regex": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"flat-cache": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
|
||||
@@ -710,27 +786,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.5.10",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
|
||||
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
|
||||
"requires": {
|
||||
"debug": "=3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||
}
|
||||
}
|
||||
"version": "1.13.0",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz",
|
||||
"integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA=="
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
@@ -750,6 +808,12 @@
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"dev": true
|
||||
},
|
||||
"get-stdin": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz",
|
||||
"integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==",
|
||||
"dev": true
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
|
||||
@@ -779,6 +843,75 @@
|
||||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
||||
"dev": true
|
||||
},
|
||||
"husky": {
|
||||
"version": "4.3.6",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-4.3.6.tgz",
|
||||
"integrity": "sha512-o6UjVI8xtlWRL5395iWq9LKDyp/9TE7XMOTvIpEVzW638UcGxTmV5cfel6fsk/jbZSTlvfGVJf2svFtybcIZag==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^4.0.0",
|
||||
"ci-info": "^2.0.0",
|
||||
"compare-versions": "^3.6.0",
|
||||
"cosmiconfig": "^7.0.0",
|
||||
"find-versions": "^3.2.0",
|
||||
"opencollective-postinstall": "^2.0.2",
|
||||
"pkg-dir": "^4.2.0",
|
||||
"please-upgrade-node": "^3.2.0",
|
||||
"slash": "^3.0.0",
|
||||
"which-pm-runs": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
|
||||
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
@@ -908,6 +1041,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"is-arrayish": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
|
||||
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
|
||||
"dev": true
|
||||
},
|
||||
"is-extglob": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||
@@ -948,33 +1087,31 @@
|
||||
"dev": true
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "3.13.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
|
||||
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
|
||||
"dev": true,
|
||||
"version": "3.14.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
|
||||
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
|
||||
"requires": {
|
||||
"argparse": "^1.0.7",
|
||||
"esprima": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"json-fixer": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/json-fixer/-/json-fixer-1.5.4.tgz",
|
||||
"integrity": "sha512-ZyMkHr45kMBzl9yeAkeMX8CAPDuL2PL+SN6s+IsPfdknpC03c5A+0190XYV2qTD4kMMZvxMuB6A3R96SEQG+EA==",
|
||||
"version": "1.6.5",
|
||||
"resolved": "https://registry.npmjs.org/json-fixer/-/json-fixer-1.6.5.tgz",
|
||||
"integrity": "sha512-ewOhCI/b7Wx0DtO7ZhDp4SW5sjvp5dBWoeGnjta7mXPrvopvcE6TYGIqo+XREhzr/hKz7Bf3e2C0TSuoGFxAYA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.10.4",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"chalk": "^4.1.0",
|
||||
"pegjs": "^0.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
|
||||
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/color-name": "^1.1.1",
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
@@ -1010,9 +1147,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
|
||||
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
@@ -1020,6 +1157,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"json-parse-even-better-errors": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
|
||||
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
|
||||
"dev": true
|
||||
},
|
||||
"json-schema-traverse": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
||||
@@ -1042,6 +1185,12 @@
|
||||
"type-check": "~0.3.2"
|
||||
}
|
||||
},
|
||||
"lines-and-columns": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
|
||||
"integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=",
|
||||
"dev": true
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||
@@ -1140,6 +1289,12 @@
|
||||
"mimic-fn": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"opencollective-postinstall": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz",
|
||||
"integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==",
|
||||
"dev": true
|
||||
},
|
||||
"optionator": {
|
||||
"version": "0.8.3",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
|
||||
@@ -1193,6 +1348,18 @@
|
||||
"callsites": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"parse-json": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz",
|
||||
"integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"error-ex": "^1.3.1",
|
||||
"json-parse-even-better-errors": "^2.3.0",
|
||||
"lines-and-columns": "^1.1.6"
|
||||
}
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||
@@ -1211,6 +1378,12 @@
|
||||
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
|
||||
"dev": true
|
||||
},
|
||||
"path-type": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
|
||||
"dev": true
|
||||
},
|
||||
"pegjs": {
|
||||
"version": "0.10.0",
|
||||
"resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz",
|
||||
@@ -1223,12 +1396,45 @@
|
||||
"integrity": "sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==",
|
||||
"dev": true
|
||||
},
|
||||
"pkg-dir": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
|
||||
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"please-upgrade-node": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
|
||||
"integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"semver-compare": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"prelude-ls": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
|
||||
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
|
||||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz",
|
||||
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==",
|
||||
"dev": true
|
||||
},
|
||||
"prettier-linter-helpers": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
|
||||
"integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-diff": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"progress": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||
@@ -1320,6 +1526,18 @@
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true
|
||||
},
|
||||
"semver-compare": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
|
||||
"integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=",
|
||||
"dev": true
|
||||
},
|
||||
"semver-regex": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz",
|
||||
"integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==",
|
||||
"dev": true
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
@@ -1348,15 +1566,31 @@
|
||||
"dev": true
|
||||
},
|
||||
"simple-git": {
|
||||
"version": "2.19.0",
|
||||
"resolved": "https://registry.npmjs.org/simple-git/-/simple-git-2.19.0.tgz",
|
||||
"integrity": "sha512-OZKxX9zHeH8JbCo8DMlERE8RsWox7Q9Jmh+lJKw/Zla8HQkiVP5I4LF5ZRfkud9XU27ZNgpccHezg1lbHw6VzQ==",
|
||||
"version": "2.27.0",
|
||||
"resolved": "https://registry.npmjs.org/simple-git/-/simple-git-2.27.0.tgz",
|
||||
"integrity": "sha512-/Q4aolzErYrIx6SgyH421jmtv5l1DaAw+KYWMWy229+isW6yld/nHGxJ2xUR/aeX3SuYJnbucyUigERwaw4Xow==",
|
||||
"requires": {
|
||||
"@kwsites/file-exists": "^1.1.1",
|
||||
"@kwsites/promise-deferred": "^1.1.1",
|
||||
"debug": "^4.1.1"
|
||||
"debug": "^4.3.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
|
||||
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
|
||||
"requires": {
|
||||
"ms": "2.1.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"slash": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
|
||||
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
|
||||
"dev": true
|
||||
},
|
||||
"slice-ansi": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz",
|
||||
@@ -1395,8 +1629,7 @@
|
||||
"sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
|
||||
"dev": true
|
||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
||||
},
|
||||
"string-width": {
|
||||
"version": "4.2.0",
|
||||
@@ -1511,12 +1744,13 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.10.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz",
|
||||
"integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==",
|
||||
"version": "9.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz",
|
||||
"integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
"create-require": "^1.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.17",
|
||||
@@ -1554,9 +1788,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz",
|
||||
"integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==",
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz",
|
||||
"integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==",
|
||||
"dev": true
|
||||
},
|
||||
"uri-js": {
|
||||
@@ -1589,6 +1823,12 @@
|
||||
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
|
||||
"dev": true
|
||||
},
|
||||
"which-pm-runs": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz",
|
||||
"integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=",
|
||||
"dev": true
|
||||
},
|
||||
"word-wrap": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||
@@ -1607,12 +1847,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
|
||||
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/color-name": "^1.1.1",
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
@@ -1663,6 +1902,12 @@
|
||||
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
|
||||
"dev": true
|
||||
},
|
||||
"yaml": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz",
|
||||
"integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==",
|
||||
"dev": true
|
||||
},
|
||||
"yamljs": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz",
|
||||
|
||||
34
package.json
34
package.json
@@ -1,16 +1,21 @@
|
||||
{
|
||||
"name": "add-and-commit",
|
||||
"version": "5.1.0",
|
||||
"version": "6.2.0",
|
||||
"description": "Add & commit files from a path directly from GitHub Actions",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build": "npm run inputs && ncc build src/main.ts --minify --out lib",
|
||||
"build": "ncc build src/main.ts --minify --out lib",
|
||||
"watch": "ncc build src/main.ts --watch --out lib",
|
||||
"all-contributors-badge": "ts-node scripts/all-contributors-badge",
|
||||
"changelog": "ts-node scripts/changelog.ts",
|
||||
"inputs": "ts-node scripts/inputs.ts",
|
||||
"lint": "eslint --ext .ts src",
|
||||
"lint:fix": "eslint --ext .ts --fix src",
|
||||
"changelog": "ts-node scripts/changelog.ts && npm i",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "npm run build && git add lib"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/EndBug/add-and-commit.git"
|
||||
@@ -30,19 +35,24 @@
|
||||
"homepage": "https://github.com/EndBug/add-and-commit#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"axios": "^0.19.2",
|
||||
"simple-git": "^2.19.0"
|
||||
"axios": "^0.21.0",
|
||||
"js-yaml": "^3.14.1",
|
||||
"simple-git": "^2.27.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^3.12.5",
|
||||
"@types/node": "^12.12.54",
|
||||
"@types/yamljs": "^0.2.31",
|
||||
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
||||
"@typescript-eslint/parser": "^2.34.0",
|
||||
"@vercel/ncc": "^0.23.0",
|
||||
"all-contributors-cli": "^6.17.2",
|
||||
"@vercel/ncc": "^0.26.1",
|
||||
"all-contributors-cli": "^6.19.0",
|
||||
"eslint": "^6.8.0",
|
||||
"ts-node": "^8.10.2",
|
||||
"typescript": "^4.0.2",
|
||||
"eslint-config-prettier": "^6.15.0",
|
||||
"eslint-plugin-prettier": "^3.3.0",
|
||||
"husky": "^4.3.6",
|
||||
"prettier": "^2.2.1",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.1.3",
|
||||
"yamljs": "^0.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
import * as fs from 'fs'
|
||||
import { resolve } from 'path'
|
||||
|
||||
function path(...segments: string[]) {
|
||||
return resolve(__dirname, '..', ...segments)
|
||||
}
|
||||
|
||||
const README = fs.readFileSync(path('README.md'), { encoding: 'utf8' }),
|
||||
{ contributors } = JSON.parse(fs.readFileSync(path('.all-contributorsrc'), { encoding: 'utf8' }))
|
||||
if (!(contributors instanceof Array)) throw new Error('Invalid config file')
|
||||
|
||||
const updatedREADME = README
|
||||
.split('\n')
|
||||
.map(line =>
|
||||
line.startsWith('[
|
||||
? `[](#contributors-)`
|
||||
: line
|
||||
).join('\n')
|
||||
|
||||
fs.writeFileSync(path('README.md'), updatedREADME)
|
||||
@@ -2,7 +2,7 @@ import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
const currentVersion = require('../package.json').version
|
||||
if (!currentVersion) throw new Error('Cant\'t detect library version.')
|
||||
if (!currentVersion) throw new Error("Cant't detect library version.")
|
||||
|
||||
const changelogPath = path.resolve(__dirname, '../CHANGELOG.md')
|
||||
const changelog = fs.readFileSync(changelogPath, { encoding: 'utf-8' })
|
||||
@@ -12,7 +12,8 @@ let futureChangelog = ''
|
||||
|
||||
// Add version section
|
||||
let arr = changelog.split('## [Unreleased]')
|
||||
arr[1] = `
|
||||
arr[1] =
|
||||
`
|
||||
|
||||
## [${currentVersion}] - ${new Date().toISOString().slice(0, 10)}
|
||||
### Removed:
|
||||
@@ -26,15 +27,15 @@ arr[1] = `
|
||||
futureChangelog = arr.join('## [Unreleased]')
|
||||
|
||||
// Update footer
|
||||
arr = futureChangelog
|
||||
.split('\n')
|
||||
.map(line => line.startsWith('[Unreleased]')
|
||||
? `[Unreleased]: https://github.com/EndBug/add-and-commit/compare/v${currentVersion}...HEAD`
|
||||
: line)
|
||||
arr = futureChangelog.split('\n').map((line) =>
|
||||
line.startsWith('[unreleased]') // The link ref is lowercase because of prettier
|
||||
? `[unreleased]: https://github.com/EndBug/add-and-commit/compare/v${currentVersion}...HEAD`
|
||||
: line
|
||||
)
|
||||
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
const lastVersion = ([...arr].reverse()[1]?.match(/\[([^\][]*)]/) || [])[0].replace(/[\[\]']+/g, '')
|
||||
if (!lastVersion) throw new Error('Can\'t find last version in changelog.')
|
||||
const lastVersion = ([...arr].reverse()[1]?.match(/\[([^\][]*)]/) ||
|
||||
[])[0].replace(/[\[\]']+/g, '') // eslint-disable-line no-useless-escape
|
||||
if (!lastVersion) throw new Error("Can't find last version in changelog.")
|
||||
|
||||
const lastLine = `[${currentVersion}]: https://github.com/EndBug/add-and-commit/compare/v${lastVersion}...v${currentVersion}`
|
||||
if (arr[arr.length - 1] === '') arr[arr.length - 1] = lastLine
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import YAML from 'yamljs'
|
||||
import fs from 'fs'
|
||||
|
||||
const actionManifest = YAML.load('action.yml'),
|
||||
inputs = Object.keys(actionManifest?.inputs || {})
|
||||
|
||||
fs.writeFileSync('src/inputs.ts', `
|
||||
// WARNING: this file is auto-generated by scripts/inputs.ts (npm run inputs), any manual edit will be overwritten.
|
||||
|
||||
export type Input = ${inputs.map(s => `'${s}'`).join(' | ')}
|
||||
`.trimLeft())
|
||||
@@ -1,3 +0,0 @@
|
||||
// WARNING: this file is auto-generated by scripts/inputs.ts (npm run inputs), any manual edit will be overwritten.
|
||||
|
||||
export type Input = 'add' | 'author_name' | 'author_email' | 'branch' | 'cwd' | 'message' | 'remove' | 'signoff' | 'tag'
|
||||
394
src/main.ts
394
src/main.ts
@@ -1,15 +1,21 @@
|
||||
import { info, setFailed, getInput as getInputCore, warning, debug, startGroup, endGroup, error } from '@actions/core'
|
||||
import {
|
||||
info,
|
||||
setFailed,
|
||||
warning,
|
||||
debug,
|
||||
startGroup,
|
||||
endGroup
|
||||
} from '@actions/core'
|
||||
import axios from 'axios'
|
||||
import path from 'path'
|
||||
import simpleGit, { Response } from 'simple-git'
|
||||
|
||||
import { Input } from './inputs'
|
||||
import YAML from 'js-yaml'
|
||||
import { getInput, Input, log, outputs, parseBool, setOutput } from './util'
|
||||
|
||||
const baseDir = path.join(process.cwd(), getInput('cwd') || '')
|
||||
const git = simpleGit({ baseDir })
|
||||
console.log(`Running in ${baseDir}`);
|
||||
|
||||
(async () => {
|
||||
console.log(`Running in ${baseDir}`)
|
||||
;(async () => {
|
||||
await checkInputs().catch(setFailed)
|
||||
|
||||
startGroup('Internal logs')
|
||||
@@ -33,7 +39,10 @@ console.log(`Running in ${baseDir}`);
|
||||
await git
|
||||
.addConfig('user.email', getInput('author_email'), undefined, log)
|
||||
.addConfig('user.name', getInput('author_name'), undefined, log)
|
||||
debug('> Current git config\n' + JSON.stringify((await git.listConfig()).all, null, 2))
|
||||
debug(
|
||||
'> Current git config\n' +
|
||||
JSON.stringify((await git.listConfig()).all, null, 2)
|
||||
)
|
||||
|
||||
await git.fetch(['--tags', '--force'], log)
|
||||
|
||||
@@ -43,42 +52,105 @@ console.log(`Running in ${baseDir}`);
|
||||
.catch(() => git.checkoutLocalBranch(getInput('branch'), log))
|
||||
|
||||
info('> Pulling from remote...')
|
||||
await git
|
||||
.fetch(undefined, log)
|
||||
.pull(undefined, undefined, undefined, log)
|
||||
await git.fetch(undefined, log).pull(
|
||||
undefined,
|
||||
undefined,
|
||||
{
|
||||
[getInput('pull_strategy')]: null
|
||||
},
|
||||
log
|
||||
)
|
||||
|
||||
info('> Re-staging files...')
|
||||
if (getInput('add')) await add({ ignoreErrors: true })
|
||||
if (getInput('remove')) await remove({ ignoreErrors: true })
|
||||
|
||||
info('> Creating commit...')
|
||||
await git.commit(getInput('message'), undefined, {
|
||||
'--author': `"${getInput('author_name')} <${getInput('author_email')}>"`,
|
||||
...(getInput('signoff') ? {
|
||||
'--signoff': null
|
||||
} : {})
|
||||
}, log)
|
||||
await git.commit(
|
||||
getInput('message'),
|
||||
undefined,
|
||||
{
|
||||
'--author': `"${getInput('author_name')} <${getInput(
|
||||
'author_email'
|
||||
)}>"`,
|
||||
...(getInput('signoff')
|
||||
? {
|
||||
'--signoff': null
|
||||
}
|
||||
: {})
|
||||
},
|
||||
(err, data?) => {
|
||||
if (data) setOutput('committed', 'true')
|
||||
return log(err, data)
|
||||
}
|
||||
)
|
||||
|
||||
if (getInput('tag')) {
|
||||
info('> Tagging commit...')
|
||||
await git.tag(getInput('tag').split(' '), log)
|
||||
await git
|
||||
.tag(getInput('tag').split(' '), (err, data?) => {
|
||||
if (data) setOutput('tagged', 'true')
|
||||
return log(err, data)
|
||||
})
|
||||
.then((data) => {
|
||||
setOutput('tagged', 'true')
|
||||
return log(null, data)
|
||||
})
|
||||
.catch((err) => setFailed(err))
|
||||
} else info('> No tag info provided.')
|
||||
|
||||
info('> Pushing commit to repo...')
|
||||
await git.push('origin', getInput('branch'), { '--set-upstream': null }, log)
|
||||
const pushOption = parseBool(getInput('push')) ?? getInput('push')
|
||||
if (pushOption) {
|
||||
// If the options is `true | string`...
|
||||
info('> Pushing commit to repo...')
|
||||
|
||||
if (getInput('tag')) {
|
||||
info('> Pushing tags to repo...')
|
||||
await git.pushTags('origin', (e, d?) => log(undefined, e || d)).catch(() => {
|
||||
info('> Tag push failed: deleting remote tag and re-pushing...')
|
||||
return git.push(undefined, undefined, {
|
||||
'--delete': null,
|
||||
'origin': null,
|
||||
[getInput('tag').split(' ').filter(w => !w.startsWith('-'))[0]]: null
|
||||
}, log)
|
||||
.pushTags('origin', log)
|
||||
})
|
||||
} else info('> No tags to push.')
|
||||
if (pushOption === true) {
|
||||
debug(`Running: git push origin ${getInput('branch')} --set-upstream`)
|
||||
await git.push(
|
||||
'origin',
|
||||
getInput('branch'),
|
||||
{ '--set-upstream': null },
|
||||
(err, data?) => {
|
||||
if (data) setOutput('pushed', 'true')
|
||||
return log(err, data)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
debug(`Running: git push ${pushOption}`)
|
||||
await git.push(
|
||||
undefined,
|
||||
undefined,
|
||||
pushOption.split(' '),
|
||||
(err, data?) => {
|
||||
if (data) setOutput('pushed', 'true')
|
||||
return log(err, data)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
if (getInput('tag')) {
|
||||
info('> Pushing tags to repo...')
|
||||
await git
|
||||
.pushTags('origin', undefined, (e, d?) => log(undefined, e || d))
|
||||
.catch(() => {
|
||||
info('> Tag push failed: deleting remote tag and re-pushing...')
|
||||
return git
|
||||
.push(
|
||||
undefined,
|
||||
undefined,
|
||||
{
|
||||
'--delete': null,
|
||||
origin: null,
|
||||
[getInput('tag')
|
||||
.split(' ')
|
||||
.filter((w) => !w.startsWith('-'))[0]]: null
|
||||
},
|
||||
log
|
||||
)
|
||||
.pushTags('origin', undefined, log)
|
||||
})
|
||||
} else info('> No tags to push.')
|
||||
} else info('> Not pushing anything.')
|
||||
|
||||
endGroup()
|
||||
info('> Task completed.')
|
||||
@@ -86,14 +158,17 @@ console.log(`Running in ${baseDir}`);
|
||||
endGroup()
|
||||
info('> Working tree clean. Nothing to commit.')
|
||||
}
|
||||
})().catch(e => {
|
||||
endGroup()
|
||||
setFailed(e)
|
||||
})
|
||||
})()
|
||||
.then(logOutputs)
|
||||
.catch((e) => {
|
||||
endGroup()
|
||||
logOutputs()
|
||||
setFailed(e)
|
||||
})
|
||||
|
||||
async function checkInputs() {
|
||||
function setInput(input: Input, value: string | undefined) {
|
||||
if (value) return process.env[`INPUT_${input.toUpperCase()}`] = value
|
||||
if (value) return (process.env[`INPUT_${input.toUpperCase()}`] = value)
|
||||
else return delete process.env[`INPUT_${input.toUpperCase()}`]
|
||||
}
|
||||
function setDefault(input: Input, value: string) {
|
||||
@@ -103,38 +178,76 @@ async function checkInputs() {
|
||||
|
||||
const eventPath = process.env.GITHUB_EVENT_PATH,
|
||||
event = eventPath && require(eventPath),
|
||||
token = process.env.GITHUB_TOKEN,
|
||||
isPR = process.env.GITHUB_EVENT_NAME?.includes('pull_request'),
|
||||
sha = (event?.pull_request?.head?.sha || process.env.GITHUB_SHA) as string,
|
||||
defaultBranch = isPR
|
||||
? event?.pull_request?.head?.ref as string
|
||||
? (event?.pull_request?.head?.ref as string)
|
||||
: process.env.GITHUB_REF?.substring(11)
|
||||
|
||||
// #region GITHUB_TOKEN
|
||||
if (!token) warning('The GITHUB_TOKEN env variable is missing: the action may not work as expected.')
|
||||
let token = process.env.GITHUB_TOKEN
|
||||
if (token) {
|
||||
debug('Using token from GITHUB_TOKEN env variable.')
|
||||
warning(
|
||||
"The GITHUB_TOKEN env variable is deprecated and will not be supported in the next major release. Use the 'token' input, " +
|
||||
"which defaults to 'secrets.GITHUB_TOKEN'."
|
||||
)
|
||||
} else {
|
||||
debug('Using token from token input.')
|
||||
token = getInput('token')
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region add, remove
|
||||
if (!getInput('add') && !getInput('remove'))
|
||||
throw new Error('Both \'add\' and \'remove\' are empty, the action has nothing to do.')
|
||||
throw new Error(
|
||||
"Both 'add' and 'remove' are empty, the action has nothing to do."
|
||||
)
|
||||
|
||||
if (getInput('add')) {
|
||||
const parsed = parseInputArray(getInput('add'))
|
||||
if (parsed.length == 1)
|
||||
info('Add input parsed as single string, running 1 git add command.')
|
||||
else if (parsed.length > 1)
|
||||
info(
|
||||
`Add input parsed as string array, running ${parsed.length} git add commands.`
|
||||
)
|
||||
else setFailed('Add input: array length < 1')
|
||||
}
|
||||
if (getInput('remove')) {
|
||||
const parsed = parseInputArray(getInput('remove'))
|
||||
if (parsed.length == 1)
|
||||
info('Remove input parsed as single string, running 1 git rm command.')
|
||||
else if (parsed.length > 1)
|
||||
info(
|
||||
`Remove input parsed as string array, running ${parsed.length} git rm commands.`
|
||||
)
|
||||
else setFailed('Remove input: array length < 1')
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region author_name, author_email
|
||||
let author = event?.head_commit?.author
|
||||
if (sha && !author) {
|
||||
info('> Unable to get commit from workflow event: trying with the GitHub API...')
|
||||
info(
|
||||
'> Unable to get commit from workflow event: trying with the GitHub API...'
|
||||
)
|
||||
|
||||
// https://docs.github.com/en/rest/reference/repos#get-a-commit--code-samples
|
||||
const url = `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/commits/${sha}`,
|
||||
headers = token ? {
|
||||
Authorization: `Bearer ${token}`
|
||||
} : undefined,
|
||||
commit = (await axios.get(url, { headers }).catch(err => {
|
||||
startGroup('Request error:')
|
||||
info(`> Request URL: ${url}\b${err}`)
|
||||
endGroup()
|
||||
return undefined
|
||||
}))?.data
|
||||
headers = token
|
||||
? {
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
: undefined,
|
||||
commit = (
|
||||
await axios.get(url, { headers }).catch((err) => {
|
||||
startGroup('Request error:')
|
||||
info(`> Request URL: ${url}\b${err}`)
|
||||
endGroup()
|
||||
return undefined
|
||||
})
|
||||
)?.data
|
||||
|
||||
author = commit?.commit?.author
|
||||
}
|
||||
@@ -148,22 +261,29 @@ async function checkInputs() {
|
||||
const reason = !eventPath
|
||||
? 'event path'
|
||||
: isPR
|
||||
? sha
|
||||
? 'fetch commit'
|
||||
: 'find commit sha'
|
||||
: !event?.head_commit
|
||||
? 'find commit'
|
||||
: 'find commit author'
|
||||
? sha
|
||||
? 'fetch commit'
|
||||
: 'find commit sha'
|
||||
: !event?.head_commit
|
||||
? 'find commit'
|
||||
: 'find commit author'
|
||||
warning(`Unable to fetch author info: couldn't ${reason}.`)
|
||||
setDefault('author_name', 'Add & Commit Action')
|
||||
setDefault('author_email', 'actions@github.com')
|
||||
}
|
||||
|
||||
info(`> Using '${getInput('author_name')} <${getInput('author_email')}>' as author.`)
|
||||
info(
|
||||
`> Using '${getInput('author_name')} <${getInput(
|
||||
'author_email'
|
||||
)}>' as author.`
|
||||
)
|
||||
// #endregion
|
||||
|
||||
// #region message
|
||||
setDefault('message', `Commit from GitHub Actions (${process.env.GITHUB_WORKFLOW})`)
|
||||
setDefault(
|
||||
'message',
|
||||
`Commit from GitHub Actions (${process.env.GITHUB_WORKFLOW})`
|
||||
)
|
||||
info(`> Using "${getInput('message')}" as commit message.`)
|
||||
// #endregion
|
||||
|
||||
@@ -173,42 +293,144 @@ async function checkInputs() {
|
||||
// #endregion
|
||||
|
||||
// #region signoff
|
||||
if (getInput('signoff')) try {
|
||||
const parsed = JSON.parse(getInput('signoff'))
|
||||
if (typeof parsed == 'boolean' && !parsed)
|
||||
setInput('signoff', undefined)
|
||||
debug(`Current signoff option: ${getInput('signoff')} (${typeof getInput('signoff')})`)
|
||||
} catch {
|
||||
throw new Error(`"${getInput('signoff')}" is not a valid value for the 'signoff' input: only "true" and "false" are allowed.`)
|
||||
if (getInput('signoff')) {
|
||||
const parsed = parseBool(getInput('signoff'))
|
||||
|
||||
if (parsed === undefined)
|
||||
throw new Error(
|
||||
`"${getInput(
|
||||
'signoff'
|
||||
)}" is not a valid value for the 'signoff' input: only "true" and "false" are allowed.`
|
||||
)
|
||||
|
||||
if (!parsed) setInput('signoff', undefined)
|
||||
|
||||
debug(
|
||||
`Current signoff option: ${getInput('signoff')} (${typeof getInput(
|
||||
'signoff'
|
||||
)})`
|
||||
)
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region push
|
||||
if (getInput('push')) {
|
||||
// It has to be either 'true', 'false', or any other string (use as arguments)
|
||||
const parsed = parseBool(getInput('push'))
|
||||
|
||||
debug(
|
||||
`Current push option: '${getInput('push')}' (parsed as ${typeof parsed})`
|
||||
)
|
||||
}
|
||||
// #endregion
|
||||
}
|
||||
|
||||
function getInput(name: Input) {
|
||||
return getInputCore(name)
|
||||
async function add({ logWarning = true, ignoreErrors = false } = {}): Promise<
|
||||
(void | Response<void>)[]
|
||||
> {
|
||||
const input = getInput('add')
|
||||
if (!input) return []
|
||||
|
||||
const parsed = parseInputArray(input)
|
||||
const res: (void | Response<void>)[] = []
|
||||
|
||||
for (const args of parsed) {
|
||||
res.push(
|
||||
// Push the result of every git command (which are executed in order) to the array
|
||||
// If any of them fails, the whole function will return a Promise rejection
|
||||
await git
|
||||
.add(args.split(' '), (err: any, data?: any) =>
|
||||
log(ignoreErrors ? null : err, data)
|
||||
)
|
||||
.catch((e: Error) => {
|
||||
if (ignoreErrors) return
|
||||
if (
|
||||
e.message.includes('fatal: pathspec') &&
|
||||
e.message.includes('did not match any files') &&
|
||||
logWarning
|
||||
)
|
||||
warning(`Add command did not match any file:\n git add ${args}`)
|
||||
else throw e
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
function log(err: any | Error, data?: any) {
|
||||
if (data) console.log(data)
|
||||
if (err) error(err)
|
||||
async function remove({
|
||||
logWarning = true,
|
||||
ignoreErrors = false
|
||||
} = {}): Promise<(void | Response<void>)[]> {
|
||||
const input = getInput('remove')
|
||||
if (!input) return []
|
||||
|
||||
const parsed = parseInputArray(input)
|
||||
const res: (void | Response<void>)[] = []
|
||||
|
||||
for (const args of parsed) {
|
||||
res.push(
|
||||
// Push the result of every git command (which are executed in order) to the array
|
||||
// If any of them fails, the whole function will return a Promise rejection
|
||||
await git
|
||||
.rm(args.split(' '), (e: any, d?: any) =>
|
||||
log(ignoreErrors ? null : e, d)
|
||||
)
|
||||
.catch((e: Error) => {
|
||||
if (ignoreErrors) return
|
||||
if (
|
||||
e.message.includes('fatal: pathspec') &&
|
||||
e.message.includes('did not match any files')
|
||||
)
|
||||
logWarning &&
|
||||
warning(
|
||||
`Remove command did not match any file:\n git rm ${args}`
|
||||
)
|
||||
else throw e
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
function add({ logWarning = true, ignoreErrors = false } = {}): Promise<void | Response<void>> | void {
|
||||
if (getInput('add'))
|
||||
return git.add(getInput('add').split(' '), (e: any, d?: any) => log(ignoreErrors ? null : e, d)).catch((e: Error) => {
|
||||
if (ignoreErrors) return
|
||||
if (e.message.includes('fatal: pathspec') && e.message.includes('did not match any files'))
|
||||
logWarning && warning('Add command did not match any file.')
|
||||
else throw e
|
||||
})
|
||||
/**
|
||||
* Tries to parse a JSON array, then a YAML array.
|
||||
* If both fail, it returns an array containing the input value as its only element
|
||||
*/
|
||||
function parseInputArray(input: string): string[] {
|
||||
try {
|
||||
const json = JSON.parse(input)
|
||||
if (
|
||||
json &&
|
||||
Array.isArray(json) &&
|
||||
json.every((e) => typeof e == 'string')
|
||||
) {
|
||||
debug(`Input parsed as JSON array of length ${json.length}`)
|
||||
return json
|
||||
}
|
||||
} catch {}
|
||||
|
||||
try {
|
||||
const yaml = YAML.safeLoad(input)
|
||||
if (
|
||||
yaml &&
|
||||
Array.isArray(yaml) &&
|
||||
yaml.every((e) => typeof e == 'string')
|
||||
) {
|
||||
debug(`Input parsed as YAML array of length ${yaml.length}`)
|
||||
return yaml
|
||||
}
|
||||
} catch {}
|
||||
|
||||
debug('Input parsed as single string')
|
||||
return [input]
|
||||
}
|
||||
|
||||
function remove({ logWarning = true, ignoreErrors = false } = {}): Promise<void | Response<void>> | void {
|
||||
if (getInput('remove'))
|
||||
return git.rm(getInput('remove').split(' '), (e: any, d?: any) => log(ignoreErrors ? null : e, d)).catch((e: Error) => {
|
||||
if (ignoreErrors) return
|
||||
if (e.message.includes('fatal: pathspec') && e.message.includes('did not match any files'))
|
||||
logWarning && warning('Remove command did not match any file.')
|
||||
else throw e
|
||||
})
|
||||
function logOutputs() {
|
||||
startGroup('Outputs')
|
||||
for (const key in outputs) {
|
||||
info(`${key}: ${outputs[key]}`)
|
||||
}
|
||||
endGroup()
|
||||
}
|
||||
|
||||
45
src/util.ts
Normal file
45
src/util.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import * as core from '@actions/core'
|
||||
|
||||
export type Input =
|
||||
| 'add'
|
||||
| 'author_name'
|
||||
| 'author_email'
|
||||
| 'branch'
|
||||
| 'cwd'
|
||||
| 'message'
|
||||
| 'pull_strategy'
|
||||
| 'push'
|
||||
| 'remove'
|
||||
| 'signoff'
|
||||
| 'tag'
|
||||
| 'token'
|
||||
|
||||
export const outputs = {
|
||||
committed: 'false',
|
||||
pushed: 'false',
|
||||
tagged: 'false'
|
||||
}
|
||||
export type Output = keyof typeof outputs
|
||||
|
||||
export function getInput(name: Input) {
|
||||
return core.getInput(name)
|
||||
}
|
||||
|
||||
export function log(err: any | Error, data?: any) {
|
||||
if (data) console.log(data)
|
||||
if (err) core.error(err)
|
||||
}
|
||||
|
||||
export function parseBool(value: any) {
|
||||
try {
|
||||
const parsed = JSON.parse(value)
|
||||
if (typeof parsed == 'boolean') return parsed
|
||||
} catch {}
|
||||
}
|
||||
|
||||
export function setOutput(name: Output, value: 'true' | 'false') {
|
||||
core.debug(`Setting output: ${name}=${value}`)
|
||||
outputs[name] = value
|
||||
return core.setOutput(name, value)
|
||||
}
|
||||
for (const key in outputs) setOutput(key as Output, outputs[key])
|
||||
Reference in New Issue
Block a user