Compare commits

...

112 Commits

Author SHA1 Message Date
Federico Grandi
b5dec7ea76 release: v5.1.0 2020-10-07 20:08:48 +02:00
allcontributors[bot]
0c4298a18d docs: add Cyberbeni as a contributor (#65)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* [auto] docs: update contributors badge

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-10-07 20:05:18 +02:00
Federico Grandi
37e118a1f5 [auto] build: update compiled version 2020-10-07 17:51:23 +00:00
Federico Grandi
3088d83852 feat: show workflow name in deafult commit message
Ref: #64
2020-10-07 19:50:38 +02:00
dependabot[bot]
3f6e296fa8 chore(deps): bump @actions/core from 1.2.4 to 1.2.6 (#62)
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.4 to 1.2.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-01 19:57:23 +02:00
Federico Grandi
82c397024b ci: change status labels 2020-09-27 12:01:38 +02:00
Federico Grandi
55e3676294 docs: formatting improvements 2020-09-27 11:39:12 +02:00
Federico Grandi
cbeb36fdb1 fix: remove old link 2020-09-27 11:37:25 +02:00
Federico Grandi
15954de18f release: v5.0.0 2020-09-27 11:34:50 +02:00
dependabot[bot]
1d34a38003 chore(deps): bump node-fetch from 2.6.0 to 2.6.1 (#60)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-25 08:48:20 +02:00
Federico Grandi
8693022acf Rewrite: TypeScript-only (#57)
* chore(deps): bump dependecies

* chore: add "inputs" script

* chore: commit local work

* chore: delete lib folder

* chore: commit local work

* BREAKING: edit action options

- force has been deleted, pass the '-f' parameter to add and remove
- ref is now called branch

* [auto] build: update compiled version

* chore: improve input checks

* [auto] build: update compiled version

* fix: pathspec errors should be catched differently

* [auto] build: update compiled version

* fix: check for 'add' and 'remove' before running commands

* [auto] build: update compiled version

* fix: log git commands

* [auto] build: update compiled version

* fix: improve logs' readability

* [auto] build: update compiled version

* chore: try not resetting files

* [auto] build: update compiled version

* fix: ignore errors on 2nd stage, log them on 1st

* [auto] build: update compiled version

* fix: signoff

* [auto] build: update compiled version

* fix: log git tag output

* [auto] build: update compiled version

* fix: use proper method for tagging

* [auto] build: update compiled version

* fix: use dedicated method for pushing tags

* [auto] build: update compiled version

* fix: using pure git tag command is better

* [auto] build: update compiled version

* fix: improve error handling

* [auto] build: update compiled version

* fix: I messed up the lines

* [auto] build: update compiled version

* fix: fix tags push when there's a forced update

* [auto] build: update compiled version

* fix: log errors too

* chore: remove unused dependecy

* [auto] build: update compiled version

* fix: don't log when using ignoreErrors

* [auto] build: update compiled version

* fix: fetch tags

* [auto] build: update compiled version

* fix: try forcing tag fetch

* [auto] build: update compiled version

* fix: try using original command for pushing tags

* [auto] build: update compiled version

* fix: try removing repo from tag command

* [auto] build: update compiled version

* fix: try with object options

* [auto] build: update compiled version

* i don't even know anymore

* [auto] build: update compiled version

* fix: try deleting the tag when it's rejected

* [auto] build: update compiled version

* fix: isolate tag name

* [auto] build: update compiled version

* fix: log result of tag deletion

* [auto] build: update compiled version

* fix: use actual values instead of references

* [auto] build: update compiled version

* fix: join netrc path with module

* [auto] build: update compiled version

* fix-: try not using .netrc at all

* [auto] build: update compiled version

* fix: remove .netrc config

* [auto] build: update compiled version

* chore: remove old shell file

* docs: update README

* chore: fix typo in action manifest

* chore: move ncc to dev-deps

* fix: cwd not working properly

* [auto] build: update compiled version
2020-09-25 08:27:39 +02:00
Federico Grandi
c7b685622a ci: fix old message 2020-09-16 08:40:49 +02:00
Federico Grandi
56800c1fe2 ci: change "stale" limit to 20 days 2020-09-16 08:35:50 +02:00
Federico Grandi
d7ef3f3a99 ci: change name to "stale" workflow 2020-08-21 14:15:47 +02:00
Federico Grandi
e9dd7a4420 ci: add "stale" workflow 2020-08-21 14:14:45 +02:00
Federico Grandi
f5a3783aa2 [auto] build: update compiled version 2020-08-21 11:33:27 +00:00
Federico Grandi
208182ae37 fix: add warning when GITHUB_TOKEN is not present
Ref issue #51
2020-08-21 13:32:46 +02:00
Federico Grandi
f7d13fceb9 docs: add changelog 2020-08-11 23:20:37 +02:00
Federico Grandi
360b5ee4b9 [auto] build: update compiled version 2020-08-11 20:17:52 +00:00
Federico Grandi
6f5455c37d fix: catch GItHub API call rejections
ref: issue #51
2020-08-11 22:17:04 +02:00
Federico Grandi
4e2f1656df ci: use bump version of this action 2020-08-08 11:02:41 +02:00
Federico Grandi
5348e90423 fix: fix build error 2020-08-08 10:54:37 +02:00
Federico Grandi
a740f7e935 docs: use custom <a> tag for "used by" badge 2020-08-05 12:17:51 +02:00
Federico Grandi
590bebf249 chore: add workflow_dispatch 2020-08-05 12:10:54 +02:00
Federico Grandi
9650af1f95 docs: add "used by" badge 2020-08-05 12:09:59 +02:00
Federico Grandi
ced56a7226 chore: switch to workflow for contributors badge 2020-08-05 12:02:19 +02:00
Federico Grandi
a988073222 release: v4.4.0 2020-07-31 20:55:15 +02:00
allcontributors[bot]
88408e5833 docs: add connorjclark as a contributor (#50)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-31 20:52:03 +02:00
Federico Grandi
27a89ad786 feat: add PR support (#49)
* feat: add PR support

* add debug steps

* fix: use console

* fix: fix buil error

* [auto] build: update compiled version

* fix: better branch handling

* [auto] build: update compiled version

* chore: remove debug steps

* fix: fetch author using GitHub API when in PR

* [auto] build: update compiled version

* feat: extend API functionality to non-PR runs

* [auto] build: update compiled version
2020-07-31 20:47:38 +02:00
Federico Grandi
d5f44e7aeb release: v4.3.0 2020-07-29 19:07:42 +02:00
allcontributors[bot]
52f10712cb docs: add pvogt09 as a contributor (#47)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 19:05:50 +02:00
pvogt09
51fc21c221 add option to use --signoff with git commit (#46)
* adds option to use --signoff with git commit

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* [auto] build: update compiled version

* fix: remove quotes and refactor

* [auto] build: update compiled version

Co-authored-by: Federico Grandi <fgrandi30@gmail.com>
2020-07-29 19:04:48 +02:00
Federico Grandi
46b61e173e release: v4.2.1 2020-07-10 20:03:38 +02:00
Federico Grandi
06d54462fa Merge pull request #44 from EndBug/all-contributors/add-JonasJacobsUserspace
docs: add JonasJacobsUserspace as a contributor
2020-07-10 17:27:46 +02:00
allcontributors[bot]
21a36873cf docs: update .all-contributorsrc [skip ci] 2020-07-10 15:27:32 +00:00
allcontributors[bot]
4d2a782ca7 docs: update README.md [skip ci] 2020-07-10 15:27:31 +00:00
Federico Grandi
feb7bba5df Merge pull request #43 from EndBug/all-contributors/add-ToMe25
docs: add ToMe25 as a contributor
2020-07-10 17:23:01 +02:00
allcontributors[bot]
30fd5a24e7 docs: update .all-contributorsrc [skip ci] 2020-07-10 15:22:37 +00:00
allcontributors[bot]
4f4dea335c docs: update README.md [skip ci] 2020-07-10 15:22:36 +00:00
Federico Grandi
caecee358e Merge pull request #42 from EndBug/all-contributors/add-jsoref
docs: add jsoref as a contributor
2020-07-10 17:21:25 +02:00
allcontributors[bot]
79fc4adbf9 docs: update .all-contributorsrc [skip ci] 2020-07-10 15:21:12 +00:00
allcontributors[bot]
4fe29d7392 docs: update README.md [skip ci] 2020-07-10 15:21:11 +00:00
Federico Grandi
2b94f96e3e docs: re-generate contributors 2020-07-10 17:19:43 +02:00
Federico Grandi
ab8370c244 Merge pull request #37 from EndBug/all-contributors/add-DmitrijOkeanij
docs: add DmitrijOkeanij as a contributor
2020-07-10 17:18:53 +02:00
Federico Grandi
61eda586c3 Merge branch 'master' into all-contributors/add-DmitrijOkeanij 2020-07-10 17:18:35 +02:00
Federico Grandi
b34850c645 Merge pull request #41 from EndBug/all-contributors/add-onilton
docs: add onilton as a contributor
2020-07-10 17:16:13 +02:00
allcontributors[bot]
f0718670ec docs: update .all-contributorsrc [skip ci] 2020-07-10 15:15:24 +00:00
allcontributors[bot]
ce9997b52f docs: update README.md [skip ci] 2020-07-10 15:15:23 +00:00
Federico Grandi
8cb387e3de Merge pull request #40 from EndBug/all-contributors/add-RobinWijnant
docs: add RobinWijnant as a contributor
2020-07-10 17:14:43 +02:00
allcontributors[bot]
4d0876f6b0 docs: update .all-contributorsrc [skip ci] 2020-07-10 15:14:11 +00:00
allcontributors[bot]
34cf82b848 docs: update README.md [skip ci] 2020-07-10 15:14:10 +00:00
Federico Grandi
8cc88cd3ac fix(contributors): fix malformed JSON 2020-07-10 17:13:43 +02:00
Federico Grandi
c94b5af098 Merge pull request #39 from EndBug/all-contributors/add-felixlapalma
docs: add felixlapalma as a contributor
2020-07-10 17:10:50 +02:00
Federico Grandi
d992c49843 Merge branch 'master' into all-contributors/add-felixlapalma 2020-07-10 17:10:39 +02:00
Federico Grandi
8a80768baa Merge pull request #38 from EndBug/all-contributors/add-brahma-dev
docs: add brahma-dev as a contributor
2020-07-10 17:06:24 +02:00
allcontributors[bot]
8b941d4dfd docs: update .all-contributorsrc [skip ci] 2020-07-10 15:05:53 +00:00
allcontributors[bot]
d5de9f3f0d docs: update README.md [skip ci] 2020-07-10 15:05:52 +00:00
allcontributors[bot]
2d9c41ae6b docs: update .all-contributorsrc [skip ci] 2020-07-10 15:05:03 +00:00
allcontributors[bot]
5560eecdc1 docs: update README.md [skip ci] 2020-07-10 15:05:02 +00:00
allcontributors[bot]
58530b3799 docs: update .all-contributorsrc [skip ci] 2020-07-10 15:03:49 +00:00
allcontributors[bot]
026e98aa42 docs: update README.md [skip ci] 2020-07-10 15:03:48 +00:00
Federico Grandi
c2e2293f44 Merge pull request #36 from EndBug/all-contributors/add-jhhughes
docs: add jhhughes as a contributor
2020-07-10 17:03:07 +02:00
allcontributors[bot]
08fe1b6e43 docs: update .all-contributorsrc [skip ci] 2020-07-10 15:02:16 +00:00
allcontributors[bot]
46d77cfa2d docs: update README.md [skip ci] 2020-07-10 15:02:15 +00:00
Federico Grandi
8feda109a1 Merge pull request #35 from EndBug/all-contributors/add-yelizariev
docs: add yelizariev as a contributor
2020-07-10 17:01:05 +02:00
allcontributors[bot]
7e9ca065e6 docs: update .all-contributorsrc [skip ci] 2020-07-10 14:59:36 +00:00
allcontributors[bot]
7acf8aea7c docs: update README.md [skip ci] 2020-07-10 14:59:35 +00:00
Federico Grandi
30fab2fa31 Merge pull request #34 from EndBug/all-contributors/add-jactor-rises
docs: add jactor-rises as a contributor
2020-07-10 16:56:30 +02:00
allcontributors[bot]
cbdf3e43f1 docs: update .all-contributorsrc [skip ci] 2020-07-10 14:55:06 +00:00
allcontributors[bot]
507713a63b docs: update README.md [skip ci] 2020-07-10 14:55:04 +00:00
Federico Grandi
c512c446c5 chore: update commit message 2020-07-10 16:51:32 +02:00
Federico Grandi
3067c9e15c docs: add @EndBug as a contributor 2020-07-10 16:50:22 +02:00
Federico Grandi
85ed07244a docs(contributors): add all-contributors 2020-07-10 16:50:14 +02:00
Federico Grandi
13550b50b0 [auto] Update compiled version 2020-07-08 14:43:47 +00:00
Federico Grandi
bf3210f533 try join instead of resolve 2020-07-08 16:42:53 +02:00
Federico Grandi
6411f389b7 [auto] Update compiled version 2020-07-08 14:40:10 +00:00
Federico Grandi
dec54c038c try using shell parameter 2020-07-08 16:37:42 +02:00
Federico Grandi
e109cd1639 [auto] Update compiled version 2020-07-08 14:11:22 +00:00
Federico Grandi
ac2b74d9d0 fix:use resolve instead of join 2020-07-08 16:10:51 +02:00
Federico Grandi
d82f4d33b7 Lock to v1 (safer) 2020-05-17 18:36:51 +02:00
Federico Grandi
d926d1c554 [auto] Update compiled version 2020-05-17 16:26:50 +00:00
Federico Grandi
8b797ba126 Fix tag clobbering 2020-05-17 18:26:13 +02:00
Federico Grandi
1b11953688 Bump version: 4.2.0 2020-05-17 18:18:56 +02:00
Federico Grandi
36bc3f778b Improve tagging docs 2020-05-17 18:17:30 +02:00
Federico Grandi
c61b317dea Merge pull request #30 from ToMe25/master
Add tagging support
2020-05-17 18:12:19 +02:00
ToMe25
22cdfa345a [auto] Update compiled version 2020-05-16 17:54:55 +00:00
ToMe25
d4aeb9335d Hopefully this time fix which commit gets tagged 2020-05-16 19:54:18 +02:00
ToMe25
46569f991f [auto] Update compiled version 2020-05-16 17:45:45 +00:00
ToMe25
83761c7e8e Hopefully fix wrong commit getting tagged 2020-05-16 19:44:48 +02:00
ToMe25
f0a1d2598a [auto] Update compiled version 2020-05-16 17:17:36 +00:00
ToMe25
c902408157 Add missing push arg 2020-05-16 19:16:43 +02:00
ToMe25
6b705fa3a4 Add tagging support 2020-05-16 18:30:49 +02:00
Federico Grandi
0e98be578d Version bump: 4.1.0 2020-05-01 15:36:30 +02:00
Federico Grandi
c07603c1c4 [auto] Update compiled version 2020-05-01 13:28:50 +00:00
Federico Grandi
9cd6e9c0ea Add ref option 2020-05-01 15:27:44 +02:00
Federico Grandi
5bf921b386 Version bump: 4.0.3 2020-05-01 11:52:28 +02:00
Federico Grandi
beedcea439 Version bump: 4.0.2 2020-05-01 11:48:19 +02:00
Federico Grandi
6cb111a771 [auto] Update compiled version 2020-05-01 09:47:36 +00:00
Federico Grandi
6a4387c9c9 Minor log improvement 2020-05-01 11:46:57 +02:00
Federico Grandi
132aa0f637 [auto] Update compiled version 2020-05-01 09:42:54 +00:00
Federico Grandi
7dbb54bce3 Add groups 2020-05-01 11:42:13 +02:00
Federico Grandi
7f1289bf4a Pipe stderr too 2020-05-01 11:39:32 +02:00
Federico Grandi
88d475f304 [auto] Update compiled version 2020-05-01 09:35:49 +00:00
Federico Grandi
98f4b8018b Try with .pipe 2020-05-01 11:35:06 +02:00
Federico Grandi
2f6a78549b [auto] Update compiled version 2020-05-01 09:26:43 +00:00
Federico Grandi
9cd727829f Try using execFile 2020-05-01 11:26:05 +02:00
Federico Grandi
f0fcdb07a3 [auto] Update compiled version 2020-05-01 09:17:33 +00:00
Federico Grandi
5ead79aef9 Try to fix logs 2020-05-01 11:16:32 +02:00
Federico Grandi
72da43cf1b Merge pull request #28 from RobinWijnant/master
Add --quiet flag to git diff
2020-05-01 11:08:07 +02:00
Robin Wijnant
9eb0d21b0d add --quiet flag git diff
This fixes ENOBUFS error which is thrown when the stdout buffer exceeds 1MB
2020-04-30 10:31:44 +02:00
Federico Grandi
2db75722ce Merge pull request #26 from jsoref/grammar
Improve grammar and formatting in README
2020-04-27 16:07:53 +02:00
Josh Soref
68d0f64f6f Grammar 2020-04-26 18:23:22 -04:00
21 changed files with 1301 additions and 297 deletions

154
.all-contributorsrc Normal file
View File

@@ -0,0 +1,154 @@
{
"projectName": "add-and-commit",
"projectOwner": "EndBug",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"commitConvention": "angular",
"contributors": [
{
"login": "EndBug",
"name": "Federico Grandi",
"avatar_url": "https://avatars1.githubusercontent.com/u/26386270?v=4",
"profile": "https://github.com/EndBug",
"contributions": [
"code",
"doc"
]
},
{
"login": "jactor-rises",
"name": "Tor Egil Jacobsen",
"avatar_url": "https://avatars3.githubusercontent.com/u/14565088?v=4",
"profile": "https://github.com/jactor-rises",
"contributions": [
"code"
]
},
{
"login": "yelizariev",
"name": "Ivan Yelizariev",
"avatar_url": "https://avatars0.githubusercontent.com/u/186131?v=4",
"profile": "https://twitter.com/yelizariev",
"contributions": [
"ideas"
]
},
{
"login": "jhhughes",
"name": "jhhughes",
"avatar_url": "https://avatars2.githubusercontent.com/u/13724293?v=4",
"profile": "https://github.com/jhhughes",
"contributions": [
"bug"
]
},
{
"login": "DmitrijOkeanij",
"name": "Дмитрий Океаний",
"avatar_url": "https://avatars3.githubusercontent.com/u/10674646?v=4",
"profile": "https://sunengine.site",
"contributions": [
"ideas"
]
},
{
"login": "brahma-dev",
"name": "Brahma Dev",
"avatar_url": "https://avatars3.githubusercontent.com/u/1793295?v=4",
"profile": "https://github.com/brahma-dev",
"contributions": [
"bug"
]
},
{
"login": "felixlapalma",
"name": "Felix Rojo Lapalma",
"avatar_url": "https://avatars2.githubusercontent.com/u/38389683?v=4",
"profile": "https://github.com/felixlapalma",
"contributions": [
"bug"
]
},
{
"login": "RobinWijnant",
"name": "Robin Wijnant",
"avatar_url": "https://avatars3.githubusercontent.com/u/33033209?v=4",
"profile": "http://robinwijnant.me",
"contributions": [
"bug",
"code"
]
},
{
"login": "onilton",
"name": "Onilton Maciel",
"avatar_url": "https://avatars2.githubusercontent.com/u/725676?v=4",
"profile": "https://github.com/onilton",
"contributions": [
"ideas"
]
},
{
"login": "jsoref",
"name": "Josh Soref",
"avatar_url": "https://avatars0.githubusercontent.com/u/2119212?v=4",
"profile": "https://github.com/jsoref",
"contributions": [
"doc"
]
},
{
"login": "ToMe25",
"name": "ToMe25",
"avatar_url": "https://avatars1.githubusercontent.com/u/38815969?v=4",
"profile": "https://github.com/ToMe25",
"contributions": [
"code",
"ideas"
]
},
{
"login": "JonasJacobsUserspace",
"name": "JonasJacobsUserspace",
"avatar_url": "https://avatars0.githubusercontent.com/u/59708720?v=4",
"profile": "https://github.com/JonasJacobsUserspace",
"contributions": [
"bug"
]
},
{
"login": "pvogt09",
"name": "pvogt09",
"avatar_url": "https://avatars3.githubusercontent.com/u/50047961?v=4",
"profile": "https://github.com/pvogt09",
"contributions": [
"code"
]
},
{
"login": "connorjclark",
"name": "Connor Clark",
"avatar_url": "https://avatars1.githubusercontent.com/u/4071474?v=4",
"profile": "http://hoten.cc",
"contributions": [
"ideas"
]
},
{
"login": "Cyberbeni",
"name": "Benedek Kozma",
"avatar_url": "https://avatars1.githubusercontent.com/u/8356175?v=4",
"profile": "https://github.com/Cyberbeni",
"contributions": [
"ideas"
]
}
],
"contributorsPerLine": 7,
"skipCi": true
}

View File

@@ -36,7 +36,8 @@
"new-cap": 0,
"no-caller": 2,
"no-undef": 2,
"no-unused-vars": 1,
"no-unused-vars": 0,
"@typescript-eslint/no-unused-vars": "warn",
"no-empty": [
"error",
{

View File

@@ -1,36 +1,37 @@
name: Build
on:
push:
branches-ignore:
- dist
paths:
- src/**
- .github/workflows/build.yml
workflow_dispatch:
jobs:
build:
name: Build compiled JS version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: npm install
- run: npm install
- name: Compile TypeScript into compressed JavaScript
run: npm run build
- run: npm run build
- name: Commit changes
uses: EndBug/add-and-commit@v4.0.0
- uses: EndBug/add-and-commit@v4
with:
message: "[auto] Update compiled version"
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 Normal file
View File

@@ -0,0 +1,29 @@
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/stale.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: 'Handle stale issues and PRs'
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is being marked as "stale" because it has been open 20 days with no activity. Remove the "stale" label or comment, otherwise this will be closed in 5 days.'
stale-issue-label: 'status: stale'
exempt-issue-labels: 'status: pinned'
stale-pr-message: 'This PR is being marked as "stale" because it has been open 20 days with no activity. Remove the "stale" label or comment, otherwise this will be closed in 5 days.'
stale-pr-label: 'status: stale'
exempt-pr-labels: 'status: pinned'
days-before-stale: 20
days-before-close: 5

View File

@@ -8,7 +8,7 @@ jobs:
actions-tagger:
runs-on: windows-latest
steps:
- uses: Actions-R-Us/actions-tagger@latest
- uses: Actions-R-Us/actions-tagger@v1
with:
publish_latest: true
env:

136
CHANGELOG.md Normal file
View File

@@ -0,0 +1,136 @@
# 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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [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:
- `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:
- 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
[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
[2.1.1]: https://github.com/EndBug/add-and-commit/compare/v2.1.0...v2.1.1
[2.2.0]: https://github.com/EndBug/add-and-commit/compare/v2.1.1...v2.2.0
[2.3.0]: https://github.com/EndBug/add-and-commit/compare/v2.2.0...v2.3.0
[2.3.1]: https://github.com/EndBug/add-and-commit/compare/v2.3.0...v2.3.1
[2.3.2]: https://github.com/EndBug/add-and-commit/compare/v2.3.1...v2.3.2
[3.0.0]: https://github.com/EndBug/add-and-commit/compare/v2.3.2...v3.0.0
[3.1.0]: https://github.com/EndBug/add-and-commit/compare/v3.0.0...v3.1.0
[4.0.0]: https://github.com/EndBug/add-and-commit/compare/v3.1.0...v4.0.0
[4.0.1]: https://github.com/EndBug/add-and-commit/compare/v4.0.0...v4.0.1
[4.0.2]: https://github.com/EndBug/add-and-commit/compare/v4.0.1...v4.0.2
[4.0.3]: https://github.com/EndBug/add-and-commit/compare/v4.0.2...v4.0.3
[4.1.0]: https://github.com/EndBug/add-and-commit/compare/v4.0.3...v4.1.0
[4.2.0]: https://github.com/EndBug/add-and-commit/compare/v4.1.0...v4.2.0
[4.2.1]: https://github.com/EndBug/add-and-commit/compare/v4.2.0...v4.2.1
[4.3.0]: https://github.com/EndBug/add-and-commit/compare/v4.2.1...v4.3.0
[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

View File

@@ -1,18 +1,20 @@
# 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>
[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat)](#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 and so on...
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....
This is **heavily** inspired by [git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) (by [Stefan Zweifel](https://github.com/stefanzweifel)): that action automatically detects changed files and commits them. While this is useful for most situations, this doesn't commit untracked files and can sometimes commit unintended changes (such as `package-lock.json` or similar, that may have happened during previous steps).
This action lets you choose the path that you want to use when adding & committing changes, so that it works as you would normally do using `git` on your machine.
This action lets you choose the path that you want to use when adding & committing changes so that it works as you would normally do using `git` on your machine.
## Usage
Add a step like this to your workflow:
```yaml
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
- uses: EndBug/add-and-commit@v5 # You can change this to use a specific version
with:
# The arguments for the git add command (see the paragraph below for more info)
# The arguments for the `git add` command (see the paragraph below for more info)
# Default: '.'
add: 'src'
@@ -20,26 +22,34 @@ Add a step like this to your workflow:
# Default: author of the commit that triggered the run
author_name: Your Name
# The The email of the user that will be displayed as the author of the commit
# The email of the user that will be displayed as the author of the commit
# Default: author of the commit that triggered the run
author_email: mail@example.com
# Name of the branch to use, if different from the one that triggered the workflow
# Default: the branch that triggered the run
branch: some-branch
# The local path to the directory where your repository is located. You should use actions/checkout first to set it up
# Default: '.'
cwd: './path/to/the/repo'
# Whether to use the --force option on git add, in order to bypass eventual gitignores
# Default: false
force: true
# The message for the commit
# Default: 'Commit from GitHub Actions'
# Default: 'Commit from GitHub Actions (name of the workflow)'
message: 'Your commit message'
# The arguments for the git rm command (see the paragraph below for more info)
# The arguments for the `git rm` command (see the paragraph below for more info)
# Default: ''
remove: "./dir/old_file.js"
# Whether to use the --signoff option on `git commit` (only `true` and `false` are accepted)
# Default: false
signoff: true
# 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"
env:
# This is necessary in order to push a commit to the repo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
@@ -48,17 +58,21 @@ Add a step like this to your workflow:
### 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).
With that said, you can just copy the example line and don't 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.
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 don't want it to use a recursive behavior: `$(find . -maxdepth 1 -name *.js)`.
The script will not stop if one 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 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.
### 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.
The script will not stop if one 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 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.
### 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).
### Examples:
@@ -88,7 +102,7 @@ jobs:
run: eslint "src/**" --fix
- name: Commit changes
uses: EndBug/add-and-commit@v4
uses: EndBug/add-and-commit@v5
with:
author_name: Your Name
author_email: mail@example.com
@@ -110,7 +124,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# If you need to, you can checkout your repo to a different location
# If you need to, you can check out your repo to a different location
- uses: actions/checkout@v2
with:
path: "./pathToRepo/"
@@ -119,16 +133,52 @@ jobs:
- 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@v4
- uses: EndBug/add-and-commit@v5
with:
message: "Add the very useful text file"
add: "*.txt"
add: "*.txt --force"
cwd: "./pathToRepo/"
force: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/EndBug"><img src="https://avatars1.githubusercontent.com/u/26386270?v=4" width="100px;" alt=""/><br /><sub><b>Federico Grandi</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=EndBug" title="Code">💻</a> <a href="https://github.com/EndBug/add-and-commit/commits?author=EndBug" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/jactor-rises"><img src="https://avatars3.githubusercontent.com/u/14565088?v=4" width="100px;" alt=""/><br /><sub><b>Tor Egil Jacobsen</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=jactor-rises" title="Code">💻</a></td>
<td align="center"><a href="https://twitter.com/yelizariev"><img src="https://avatars0.githubusercontent.com/u/186131?v=4" width="100px;" alt=""/><br /><sub><b>Ivan Yelizariev</b></sub></a><br /><a href="#ideas-yelizariev" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/jhhughes"><img src="https://avatars2.githubusercontent.com/u/13724293?v=4" width="100px;" alt=""/><br /><sub><b>jhhughes</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3Ajhhughes" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://sunengine.site"><img src="https://avatars3.githubusercontent.com/u/10674646?v=4" width="100px;" alt=""/><br /><sub><b>Дмитрий Океаний</b></sub></a><br /><a href="#ideas-DmitrijOkeanij" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/brahma-dev"><img src="https://avatars3.githubusercontent.com/u/1793295?v=4" width="100px;" alt=""/><br /><sub><b>Brahma Dev</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3Abrahma-dev" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/felixlapalma"><img src="https://avatars2.githubusercontent.com/u/38389683?v=4" width="100px;" alt=""/><br /><sub><b>Felix Rojo Lapalma</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3Afelixlapalma" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="http://robinwijnant.me"><img src="https://avatars3.githubusercontent.com/u/33033209?v=4" width="100px;" alt=""/><br /><sub><b>Robin Wijnant</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3ARobinWijnant" title="Bug reports">🐛</a> <a href="https://github.com/EndBug/add-and-commit/commits?author=RobinWijnant" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/onilton"><img src="https://avatars2.githubusercontent.com/u/725676?v=4" width="100px;" alt=""/><br /><sub><b>Onilton Maciel</b></sub></a><br /><a href="#ideas-onilton" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/jsoref"><img src="https://avatars0.githubusercontent.com/u/2119212?v=4" width="100px;" alt=""/><br /><sub><b>Josh Soref</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=jsoref" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/ToMe25"><img src="https://avatars1.githubusercontent.com/u/38815969?v=4" width="100px;" alt=""/><br /><sub><b>ToMe25</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=ToMe25" title="Code">💻</a> <a href="#ideas-ToMe25" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/JonasJacobsUserspace"><img src="https://avatars0.githubusercontent.com/u/59708720?v=4" width="100px;" alt=""/><br /><sub><b>JonasJacobsUserspace</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/issues?q=author%3AJonasJacobsUserspace" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/pvogt09"><img src="https://avatars3.githubusercontent.com/u/50047961?v=4" width="100px;" alt=""/><br /><sub><b>pvogt09</b></sub></a><br /><a href="https://github.com/EndBug/add-and-commit/commits?author=pvogt09" title="Code">💻</a></td>
<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>
</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!
## License
This action is distributed under the MIT license, check the [license](LICENSE) for more info.

View File

@@ -5,29 +5,32 @@ inputs:
add:
description: Arguments for the git add command
required: false
default: "."
default: '.'
author_name:
description: The name of the user that will be displayed as the author of the commit
required: false
author_email:
description: The email of the user that will be displayed as the author of the commit
required: false
branch:
description: Name of the branch to use, if different from the one that triggered the workflow
required: false
cwd:
description: The directory where your repository is located. You should use actions/checkout first to set it up
required: false
default: "."
force:
description: Whether to use the force option on git add, in order to bypass eventual gitignores
required: false
default: "false"
default: '.'
message:
description: The message for the commit
required: false
default: Commit from GitHub Actions
remove:
description: Arguments for the git rm command
required: false
default: ""
signoff:
description: Whether to use the --signoff option on git commit
required: false
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
runs:
using: node12

View File

View File

@@ -1,73 +0,0 @@
#!/bin/bash
set -u
cd $INPUT_CWD
echo "Running in $PWD."
# Set up .netrc file with GitHub credentials
git_setup() {
cat <<-EOF >$HOME/.netrc
machine github.com
login $GITHUB_ACTOR
password $GITHUB_TOKEN
machine api.github.com
login $GITHUB_ACTOR
password $GITHUB_TOKEN
EOF
chmod 600 $HOME/.netrc
git config --global user.email "$INPUT_AUTHOR_EMAIL"
git config --global user.name "$INPUT_AUTHOR_NAME"
}
add() {
if $INPUT_FORCE; then f=-f; else f=; fi
git add $INPUT_ADD $f
}
remove() {
if [ -n "$INPUT_REMOVE" ]; then git rm $INPUT_REMOVE; fi
}
# This is needed to make the check work for untracked files
echo "Staging files..."
add
remove
echo "Checking for uncommitted changes in the git working tree..."
# This section only runs if there have been file changes
if ! git diff --cached --exit-code; then
git_setup
git fetch
# Verify if the branch needs to be created
if ! git rev-parse --verify --quiet "${GITHUB_REF:11}"; then
echo "Creating branch..."
git branch "${GITHUB_REF:11}"
fi
# Switch to branch from current workflow run
echo "Switching branch..."
git checkout "${GITHUB_REF:11}"
echo "Pulling from remote..."
git fetch && git pull
echo "Resetting files..."
git reset
echo "Adding files..."
add
echo "Removing files..."
remove
echo "Creating commit..."
git commit -m "$INPUT_MESSAGE" --author="$INPUT_AUTHOR_NAME <$INPUT_AUTHOR_EMAIL>"
echo "Pushing to repo..."
git push --set-upstream origin "${GITHUB_REF:11}"
else
echo "Working tree clean. Nothing to commit."
fi

File diff suppressed because one or more lines are too long

640
package-lock.json generated
View File

@@ -1,13 +1,13 @@
{
"name": "add-and-commit",
"version": "4.0.0",
"version": "5.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@actions/core": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz",
"integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w=="
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
},
"@babel/code-frame": {
"version": "7.8.3",
@@ -29,6 +29,28 @@
"js-tokens": "^4.0.0"
}
},
"@babel/runtime": {
"version": "7.11.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz",
"integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
}
},
"@kwsites/file-exists": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz",
"integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==",
"requires": {
"debug": "^4.1.1"
}
},
"@kwsites/promise-deferred": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz",
"integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw=="
},
"@types/color-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
@@ -41,91 +63,75 @@
"integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==",
"dev": true
},
"@types/events": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
"integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==",
"dev": true
},
"@types/glob": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz",
"integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==",
"dev": true,
"requires": {
"@types/events": "*",
"@types/minimatch": "*",
"@types/node": "*"
}
},
"@types/json-schema": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz",
"integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==",
"dev": true
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz",
"integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==",
"dev": true
},
"@types/node": {
"version": "12.12.30",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.30.tgz",
"integrity": "sha512-sz9MF/zk6qVr3pAnM0BSQvYIBK44tS75QC5N+VbWSE4DjCV/pJ+UzCW/F+vVnl7TkOPcuwQureKNtSSwjBTaMg==",
"version": "12.12.54",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.54.tgz",
"integrity": "sha512-ge4xZ3vSBornVYlDnk7yZ0gK6ChHf/CHB7Gl1I0Jhah8DDnEQqBzgohYG4FX4p81TNirSETOiSyn+y1r9/IR6w==",
"dev": true
},
"@types/shelljs": {
"version": "0.8.6",
"resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.6.tgz",
"integrity": "sha512-svx2eQS268awlppL/P8wgDLBrsDXdKznABHJcuqXyWpSKJgE1s2clXlBvAwbO/lehTmG06NtEWJRkAk4tAgenA==",
"dev": true,
"requires": {
"@types/glob": "*",
"@types/node": "*"
}
"@types/yamljs": {
"version": "0.2.31",
"resolved": "https://registry.npmjs.org/@types/yamljs/-/yamljs-0.2.31.tgz",
"integrity": "sha512-QcJ5ZczaXAqbVD3o8mw/mEBhRvO5UAdTtbvgwL/OgoWubvNBh6/MxLBAigtcgIFaq3shon9m3POIxQaLQt4fxQ==",
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.24.0.tgz",
"integrity": "sha512-wJRBeaMeT7RLQ27UQkDFOu25MqFOBus8PtOa9KaT5ZuxC1kAsd7JEHqWt4YXuY9eancX0GK9C68i5OROnlIzBA==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz",
"integrity": "sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "2.24.0",
"eslint-utils": "^1.4.3",
"@typescript-eslint/experimental-utils": "2.34.0",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0",
"tsutils": "^3.17.1"
}
},
"@typescript-eslint/experimental-utils": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.24.0.tgz",
"integrity": "sha512-DXrwuXTdVh3ycNCMYmWhUzn/gfqu9N0VzNnahjiDJvcyhfBy4gb59ncVZVxdp5XzBC77dCncu0daQgOkbvPwBw==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz",
"integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/typescript-estree": "2.24.0",
"eslint-scope": "^5.0.0"
"@typescript-eslint/typescript-estree": "2.34.0",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
},
"dependencies": {
"eslint-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
"integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
"dev": true,
"requires": {
"eslint-visitor-keys": "^1.1.0"
}
}
}
},
"@typescript-eslint/parser": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.24.0.tgz",
"integrity": "sha512-H2Y7uacwSSg8IbVxdYExSI3T7uM1DzmOn2COGtCahCC3g8YtM1xYAPi2MAHyfPs61VKxP/J/UiSctcRgw4G8aw==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.34.0.tgz",
"integrity": "sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA==",
"dev": true,
"requires": {
"@types/eslint-visitor-keys": "^1.0.0",
"@typescript-eslint/experimental-utils": "2.24.0",
"@typescript-eslint/typescript-estree": "2.24.0",
"@typescript-eslint/experimental-utils": "2.34.0",
"@typescript-eslint/typescript-estree": "2.34.0",
"eslint-visitor-keys": "^1.1.0"
}
},
"@typescript-eslint/typescript-estree": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.24.0.tgz",
"integrity": "sha512-RJ0yMe5owMSix55qX7Mi9V6z2FDuuDpN6eR5fzRJrp+8in9UF41IGNQHbg5aMK4/PjVaEQksLvz0IA8n+Mr/FA==",
"version": "2.34.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz",
"integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==",
"dev": true,
"requires": {
"debug": "^4.1.1",
@@ -133,14 +139,22 @@
"glob": "^7.1.6",
"is-glob": "^4.0.1",
"lodash": "^4.17.15",
"semver": "^6.3.0",
"semver": "^7.3.2",
"tsutils": "^3.17.1"
},
"dependencies": {
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
"dev": true
}
}
},
"@zeit/ncc": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.21.1.tgz",
"integrity": "sha512-M9WzgquSOt2nsjRkYM9LRylBLmmlwNCwYbm3Up3PDEshfvdmIfqpFNSK8EJvR18NwZjGHE5z2avlDtYQx2JQnw==",
"@vercel/ncc": {
"version": "0.23.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.23.0.tgz",
"integrity": "sha512-Fcr1qlG9t54X4X9qbo/+jr1+t5Qc6H3TgIRBXmKkF/WDs6YFulAN6ilq2Ehx38RbgIOFxaZnjlAQ50GyexnMpQ==",
"dev": true
},
"acorn": {
@@ -167,6 +181,76 @@
"uri-js": "^4.2.2"
}
},
"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==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.6",
"async": "^3.0.1",
"chalk": "^4.0.0",
"didyoumean": "^1.2.1",
"inquirer": "^7.0.4",
"json-fixer": "^1.5.1",
"lodash": "^4.11.2",
"node-fetch": "^2.6.0",
"pify": "^5.0.0",
"yargs": "^15.0.1"
},
"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==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"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.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"ansi-escapes": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz",
@@ -199,6 +283,12 @@
"color-convert": "^1.9.0"
}
},
"arg": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
"dev": true
},
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
@@ -214,6 +304,20 @@
"integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==",
"dev": true
},
"async": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
"integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==",
"dev": true
},
"axios": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
"requires": {
"follow-redirects": "1.5.10"
}
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@@ -230,12 +334,24 @@
"concat-map": "0.0.1"
}
},
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"dev": true
},
"camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"dev": true
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
@@ -268,6 +384,28 @@
"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
"dev": true
},
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"dev": true,
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
},
"dependencies": {
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.0"
}
}
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
@@ -314,17 +452,34 @@
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"dev": true,
"requires": {
"ms": "^2.1.1"
}
},
"decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
"dev": true
},
"deep-is": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
"dev": true
},
"didyoumean": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.1.tgz",
"integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=",
"dev": true
},
"diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true
},
"doctrine": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
@@ -527,6 +682,16 @@
"flat-cache": "^2.0.1"
}
},
"find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
}
},
"flat-cache": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
@@ -544,6 +709,29 @@
"integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==",
"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="
}
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -556,6 +744,12 @@
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
"dev": true
},
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true
},
"glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
@@ -763,6 +957,69 @@
"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==",
"dev": true,
"requires": {
"@babel/runtime": "^7.10.4",
"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==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"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.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
@@ -785,10 +1042,25 @@
"type-check": "~0.3.2"
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"requires": {
"p-locate": "^4.1.0"
}
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"dev": true
},
"make-error": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
"dev": true
},
"mimic-fn": {
@@ -824,8 +1096,7 @@
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"mute-stream": {
"version": "0.0.8",
@@ -845,6 +1116,12 @@
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true
},
"node-fetch": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
"dev": true
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@@ -883,6 +1160,30 @@
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
},
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
}
},
"p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"requires": {
"p-limit": "^2.2.0"
}
},
"p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@@ -892,6 +1193,12 @@
"callsites": "^3.0.0"
}
},
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
@@ -904,6 +1211,18 @@
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"dev": true
},
"pegjs": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz",
"integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=",
"dev": true
},
"pify": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz",
"integrity": "sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==",
"dev": true
},
"prelude-ls": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
@@ -922,10 +1241,28 @@
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"dev": true
},
"regenerator-runtime": {
"version": "0.13.7",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz",
"integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==",
"dev": true
},
"regexpp": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.0.0.tgz",
"integrity": "sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
"integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
"dev": true
},
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
"dev": true
},
"require-main-filename": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"dev": true
},
"resolve-from": {
@@ -983,6 +1320,12 @@
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
},
"set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"dev": true
},
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
@@ -1004,6 +1347,16 @@
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"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==",
"requires": {
"@kwsites/file-exists": "^1.1.1",
"@kwsites/promise-deferred": "^1.1.1",
"debug": "^4.1.1"
}
},
"slice-ansi": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz",
@@ -1023,6 +1376,22 @@
}
}
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"source-map-support": {
"version": "0.5.19",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
"integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@@ -1141,6 +1510,19 @@
"os-tmpdir": "~1.0.2"
}
},
"ts-node": {
"version": "8.10.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz",
"integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==",
"dev": true,
"requires": {
"arg": "^4.1.0",
"diff": "^4.0.1",
"make-error": "^1.1.1",
"source-map-support": "^0.5.17",
"yn": "3.1.1"
}
},
"tslib": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz",
@@ -1172,9 +1554,9 @@
"dev": true
},
"typescript": {
"version": "3.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz",
"integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==",
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz",
"integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==",
"dev": true
},
"uri-js": {
@@ -1201,12 +1583,65 @@
"isexe": "^2.0.0"
}
},
"which-module": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"dev": true
},
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"dev": true
},
"wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.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==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"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
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.0"
}
}
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
@@ -1221,6 +1656,57 @@
"requires": {
"mkdirp": "^0.5.1"
}
},
"y18n": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"dev": true
},
"yamljs": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz",
"integrity": "sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==",
"dev": true,
"requires": {
"argparse": "^1.0.7",
"glob": "^7.0.5"
}
},
"yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"dev": true,
"requires": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
}
},
"yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"dev": true,
"requires": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
}
},
"yn": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
"dev": true
}
}
}

View File

@@ -1,11 +1,14 @@
{
"name": "add-and-commit",
"version": "4.0.1",
"version": "5.1.0",
"description": "Add & commit files from a path directly from GitHub Actions",
"main": "lib/index.js",
"scripts": {
"build": "npm i && ncc build src/main.ts --minify --out lib",
"build": "npm run inputs && 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",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
@@ -26,15 +29,20 @@
},
"homepage": "https://github.com/EndBug/add-and-commit#readme",
"dependencies": {
"@actions/core": "^1.1.3"
"@actions/core": "^1.2.6",
"axios": "^0.19.2",
"simple-git": "^2.19.0"
},
"devDependencies": {
"@types/node": "^12.7.12",
"@types/shelljs": "^0.8.6",
"@typescript-eslint/eslint-plugin": "^2.12.0",
"@typescript-eslint/parser": "^2.12.0",
"@zeit/ncc": "^0.21.1",
"@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",
"eslint": "^6.8.0",
"typescript": "^3.6.4"
"ts-node": "^8.10.2",
"typescript": "^4.0.2",
"yamljs": "^0.3.0"
}
}

View File

@@ -0,0 +1,20 @@
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('[![All Contributors](https://img.shields.io/badge/all_contributors-')
? `[![All Contributors](https://img.shields.io/badge/all_contributors-${contributors.length}-orange.svg?style=flat)](#contributors-)`
: line
).join('\n')
fs.writeFileSync(path('README.md'), updatedREADME)

44
scripts/changelog.ts Normal file
View File

@@ -0,0 +1,44 @@
import fs from 'fs'
import path from 'path'
const currentVersion = require('../package.json').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' })
if (changelog.includes(`## [${currentVersion}]`))
throw new Error('Current version has already been documented.')
let futureChangelog = ''
// Add version section
let arr = changelog.split('## [Unreleased]')
arr[1] = `
## [${currentVersion}] - ${new Date().toISOString().slice(0, 10)}
### Removed:
- **[BREAKING]** ListName: description
### Added:
-
### Fixed:
- ` + 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)
// 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 lastLine = `[${currentVersion}]: https://github.com/EndBug/add-and-commit/compare/v${lastVersion}...v${currentVersion}`
if (arr[arr.length - 1] === '') arr[arr.length - 1] = lastLine
else arr.push(lastLine)
futureChangelog = arr.join('\n')
fs.writeFileSync(changelogPath, futureChangelog)

11
scripts/inputs.ts Normal file
View File

@@ -0,0 +1,11 @@
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())

View File

@@ -1,73 +0,0 @@
#!/bin/bash
set -u
cd $INPUT_CWD
echo "Running in $PWD."
# Set up .netrc file with GitHub credentials
git_setup() {
cat <<-EOF >$HOME/.netrc
machine github.com
login $GITHUB_ACTOR
password $GITHUB_TOKEN
machine api.github.com
login $GITHUB_ACTOR
password $GITHUB_TOKEN
EOF
chmod 600 $HOME/.netrc
git config --global user.email "$INPUT_AUTHOR_EMAIL"
git config --global user.name "$INPUT_AUTHOR_NAME"
}
add() {
if $INPUT_FORCE; then f=-f; else f=; fi
git add $INPUT_ADD $f
}
remove() {
if [ -n "$INPUT_REMOVE" ]; then git rm $INPUT_REMOVE; fi
}
# This is needed to make the check work for untracked files
echo "Staging files..."
add
remove
echo "Checking for uncommitted changes in the git working tree..."
# This section only runs if there have been file changes
if ! git diff --cached --exit-code; then
git_setup
git fetch
# Verify if the branch needs to be created
if ! git rev-parse --verify --quiet "${GITHUB_REF:11}"; then
echo "Creating branch..."
git branch "${GITHUB_REF:11}"
fi
# Switch to branch from current workflow run
echo "Switching branch..."
git checkout "${GITHUB_REF:11}"
echo "Pulling from remote..."
git fetch && git pull
echo "Resetting files..."
git reset
echo "Adding files..."
add
echo "Removing files..."
remove
echo "Creating commit..."
git commit -m "$INPUT_MESSAGE" --author="$INPUT_AUTHOR_NAME <$INPUT_AUTHOR_EMAIL>"
echo "Pushing to repo..."
git push --set-upstream origin "${GITHUB_REF:11}"
else
echo "Working tree clean. Nothing to commit."
fi

3
src/inputs.ts Normal file
View File

@@ -0,0 +1,3 @@
// 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'

View File

@@ -1,32 +1,214 @@
import { info, setFailed, getInput, warning } from '@actions/core'
import { join as path } from 'path'
import { execFileSync } from 'child_process'
import { info, setFailed, getInput as getInputCore, warning, debug, startGroup, endGroup, error } from '@actions/core'
import axios from 'axios'
import path from 'path'
import simpleGit, { Response } from 'simple-git'
try {
checkInputs()
execFileSync(path(__dirname, 'entrypoint.sh'))
} catch (err) {
console.error(err)
setFailed(err instanceof Error ? err.message : err)
}
import { Input } from './inputs'
function checkInputs() {
const eventPath = process.env.GITHUB_EVENT_PATH
const author = eventPath && require(eventPath)?.head_commit?.author
const baseDir = path.join(process.cwd(), getInput('cwd') || '')
const git = simpleGit({ baseDir })
console.log(`Running in ${baseDir}`);
(async () => {
await checkInputs().catch(setFailed)
startGroup('Internal logs')
info('> Staging files...')
if (getInput('add')) {
info('> Adding files...')
await add()
} else info('> No files to add.')
if (getInput('remove')) {
info('> Removing files...')
await remove()
} else info('> No files to remove.')
info('> Checking for uncommitted changes in the git working tree...')
const changedFiles = (await git.diffSummary(['--cached'])).files.length
if (changedFiles > 0) {
info(`> Found ${changedFiles} changed files.`)
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))
await git.fetch(['--tags', '--force'], log)
info('> Switching/creating branch...')
await git
.checkout(getInput('branch'), undefined, log)
.catch(() => git.checkoutLocalBranch(getInput('branch'), log))
info('> Pulling from remote...')
await git
.fetch(undefined, log)
.pull(undefined, undefined, undefined, 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)
if (getInput('tag')) {
info('> Tagging commit...')
await git.tag(getInput('tag').split(' '), log)
} else info('> No tag info provided.')
info('> Pushing commit to repo...')
await git.push('origin', getInput('branch'), { '--set-upstream': null }, log)
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.')
endGroup()
info('> Task completed.')
} else {
endGroup()
info('> Working tree clean. Nothing to commit.')
}
})().catch(e => {
endGroup()
setFailed(e)
})
async function checkInputs() {
function setInput(input: Input, value: string | undefined) {
if (value) return process.env[`INPUT_${input.toUpperCase()}`] = value
else return delete process.env[`INPUT_${input.toUpperCase()}`]
}
function setDefault(input: Input, value: string) {
if (!getInput(input)) setInput(input, value)
return getInput(input)
}
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
: 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.')
// #endregion
// #region add, remove
if (!getInput('add') && !getInput('remove'))
throw new Error('Both \'add\' and \'remove\' are empty, the action has nothing to do.')
// #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...')
// 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
author = commit?.commit?.author
}
if (author) {
setDefault('author_name', author.name)
setDefault('author_email', author.email)
} else {
if (!getInput('author_name') || !getInput('author_email')) warning(`Unable to fetch author info: couldn't find ${!eventPath ? 'event path' : !require(eventPath)?.head_commit ? 'commit' : 'commit author'}.`)
}
if (!getInput('author_name') || !getInput('author_email')) {
const reason = !eventPath
? 'event path'
: isPR
? 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})`)
info(`> Using "${getInput('message')}" as commit message.`)
// #endregion
// #region branch
const branch = setDefault('branch', defaultBranch || '')
if (isPR) info(`> Running for a PR, the action will use '${branch}' as ref.`)
// #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.`)
}
// #endregion
}
function setDefault(input: string, value: string) {
const key = 'INPUT_' + input.toUpperCase()
if (!process.env[key]) process.env[key] = value
function getInput(name: Input) {
return getInputCore(name)
}
function log(err: any | Error, data?: any) {
if (data) console.log(data)
if (err) error(err)
}
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
})
}
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
})
}

View File

@@ -56,6 +56,7 @@
},
"exclude": [
"node_modules",
"**/*.test.ts"
"**/*.test.ts",
"scripts"
]
}